pythondaily | Education

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Subscribe to a channel

Python Daily

Friday Daily Thread: r/Python Meta and Free-Talk Fridays

# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

## How it Works:

1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

## Guidelines:

All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.

## Example Topics:

1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟

/r/Python
https://redd.it/1grj5d8

Читать полностью…

Python Daily

What's the most complex/Impressive thing you've built using Django?

By complex i mean code-wise. What's something that you built that really push the capabilities of Django and maybe Python? use this as a chance to show off.

/r/django
https://redd.it/1grri9o

Читать полностью…

Python Daily

Is django a good choice?

Hey guys,

I currently trying to find the best solution to implement for a client of mine.

What started as a simple HRM implementation now runs more towards some kind of lean ERP solution.

I need something that can handle a lot of employee information and turnover across multiple clients and contracts types to generate accurate and pretty much automatic timesheets and invoicing.

The company is pretty only generating pay and invoices, but these have to follow pretty complex business rules.

I also have to handle a few HR processes that include on-boarding and termination along with some kind of document and signature tracking

Nothing out of the ordinary, but I couldn't find a solution that could do that without heavy customization and license fees.

I am leaning toward erpnext/frappe, but the installation process is much more complex than what I envisioned. I am also thinking about building something myself with Django and bootstraps or react, but I do not have great coding skills so build on something that is pre-existing would be much more approachable for me.

Any suggestions? I am in dire need of help here.

/r/django
https://redd.it/1groo4a

Читать полностью…

Python Daily

Just Finished Studying Django Official Docs Tutorials

I am a BSc with Computer Science and Mathematics major, done with the academic year and going to 3/4 year of the degree. I am interested in backend engineering and want to be job ready by the time I graduate, which is why I am learning Django. My aimed stack as a student is just HTMX, Django and Postgres, nothing complicated.

I have 6 projects (sites) that I want to have been done with by the time I graduate:

* **Student Analytics App**
* **Residence Management System**
* **Football Analytics Platform**
* **Social Network**
* **Trading Journal**
* **Student Scheduling System**

I have about 3 months to study Django and math alternatingly. I believe I can get a decent studying of Django done by the time my next academic year commences and continue studying it whenever I get the chance during my academic year.

Anyways, enough with the blabbering, I just got done studying the Django tutorials from the official docs. I love the tutorials, especially as someone who always considered YouTube tutorials over official docs. This is the first documentation I actually read to learn and not to troubleshoot/fix a bug in my code. I think it is very well written!

I wanted to ask:

* Is there any resource

/r/django
https://redd.it/1greaqn

Читать полностью…

Python Daily

Make your Github profile more attractive as a Python Developer

What My Project Does:

This project automates the process of showcasing detailed analytics and visual insights of your Python repositories on your GitHub profile using GitHub Actions. Once set up, it gathers and updates key statistics on every push, appending the latest information to the bottom of your README without disrupting existing content. The visualizations are compiled into a gif, ensuring that your profile remains clean and visually engaging.

With this tool, you can automatically analyze, generate, and display visuals for the following metrics:

\- Repository breakdown by commits and lines of Python code

\- Heatmap of commit activity by day and time

\- Word cloud of commit messages

\- File type distribution across repositories

\- Libraries used in each repository

\- Construct counts (including loops, classes, control flow statements, async functions, etc.)

\- Highlights of the most recent closed PRs and commits

By implementing these automated insights, your profile stays up-to-date with real-time data, giving visitors a dynamic view of your work without any manual effort.

\---

Target Audience:

This tool is designed for Python developers and GitHub users who want to showcase their project activity, code structure, and commit history visually on their profile. It’s ideal for those who value continuous profile enhancement with minimal maintenance, making it useful for developers

/r/Python
https://redd.it/1gr4qkw

Читать полностью…

Python Daily

Automation question

Hey all,

I'm trying to automate a process at my work to improve my efficiency. For context, imagine I work at workplace A which has its own database of information that staff need to access. On top of this there's workplaces B and C also who have the same situation. However all 3 workplaces need to access each of the workplaces data (A, B and C) which is done via a website. On the website we have to click a link down the bottom corner of the page to "swap workplace". This opens a new page where we then select the workplace we want and click submit.

Is there anyway to automate this process of being able to just click a button and automatically be open up workplace A, without having to go into the menu.

There is no identifying feature for the workplace in the URL so I can't just bookmark different urls.

My initial thoughts were too have a process that targets particular ui elements and clicks them in series to do the job.

Thoughts?


Any help would be awesome!


/r/Python
https://redd.it/1gqzgv6

Читать полностью…

Python Daily

Advice for Django Job

I recently started learning Django. I know how to make simple APIs with DRF. But I feel like there are too many abstractions like it makes it so easy to make a rest api. Anyways, Can some please tell me how to make it to full stack.... Is server side rendering and jinja templating all? Because on the other hand NextJS and React thing is very popular. I am studying AI/ML in parallel so what texh stach would be good for me?
I only want a job or internship with descent >= 5LPA salary as of now as I am in 3rd year. Whats the shortest way to do that.
PS: I also do competitive programming and am 2 star on codechef but I am kinda confused with what path to follow.

/r/django
https://redd.it/1gqwr77

Читать полностью…

Python Daily

I'm puzzled trying to update just 1 m2m object in a form

I have a form in a template where I want the ability to check a box and it shows an interest in a game for an official. There is a many-to-many relationship between games and officials.

In the template, the form presents only the user of all officials to either check or uncheck for a game.

If the user makes any change (checks or unchecks), they essentially uncheck all users associated with that game.

Please help point me in the right direction.

Here are relevant sections of code:

[models.py](http://models.py)

class Official(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
class Game(models.Model):
game_official_options = models.ManyToManyField(Official, blank=True, related_name='officials')

[view.py](http://view.py)

def GameDetail(request, slug):
game = officials_models.Game.objects.get(slug=slug)
if request.method == "POST":
form = officials_forms.GameInterestForm(request.user, , instance=game)
if form.is_valid():
post = form.save(commit=False)


/r/django
https://redd.it/1gqo5j5

Читать полностью…

Python Daily

Tutorial: Turning django to async without using async
https://gist.github.com/akhushnazarov/2f21bfa5227d85e87a29ad0df6a1d967

/r/django
https://redd.it/1gqlsln

Читать полностью…

Python Daily

how to fix this error

https://preview.redd.it/84tnr7elto0e1.png?width=1920&format=png&auto=webp&s=ee322705a25906a7fbb4de8f961918d5d8940026



/r/flask
https://redd.it/1gqfhnb

Читать полностью…

Python Daily

Is async django ready for prime time? Our async django production experience

We have traditionally used Django in all our products. We believe it is one of the most underrated, beautifully designed, rock solid framework out there.

However, if we are to be honest, the history of async usage in Django wasn't very impressive. You could argue that for most products, you don’t really need async. It was just an extra layer of complexity without any significant practical benefit.

Over the last couple of years, AI use-cases have changed that perception. Many AI products have calling external APIs over the network as their bottleneck. This makes the complexity from async Python worth considering. FastAPI with its intuitive async usage and simplicity have risen to be the default API/web layer for AI projects.

I wrote about using async Django in a relatively complex AI open source project here: https://jonathanadly.com/is-async-django-ready-for-prime-time

tldr: Async django is ready! there is a couple of gotcha's here and there, but there should be no performance loss when using async Django instead of FastAPI for the same tasks. Django's built-in features greatly simplify and enhance the developer experience.

So - go ahead and use async Django in your next project. It should be a lot smoother that it was a year

/r/django
https://redd.it/1gqfyw3

Читать полностью…

Python Daily

Question about libraries

I don't understand how I should learn libraries. Let me explain: reading them I often don't understand what is written, it's all so difficult and technical. So I think "maybe I should watch an introductory video?" but I don't do it because it seems ethically wrong, I think I should learn by myself and not relying on someone's help every time. Can you tell me how you understand a library? Or a set of libraries needed to create a type of application (even more difficult since I don't even know which library to start with).

/r/Python
https://redd.it/1gq8qj3

Читать полностью…

Python Daily

Building efficient API in Django REST framework, Django-ninja, and comparing to Golang

A few days ago I wrote about a step-by-step guide in optimizing an API written in Django REST Framework for retrieving large amount data (100k+ records), and most Redditors here liked it.

I have now added the same example written with Django-ninja to compare. Just for fun I also added a very light weight Golang implementation of the identical API.

https://preview.redd.it/11phws0hpl0e1.png?width=600&format=png&auto=webp&s=b34cf1b2c6fbb2ca16760431b4890954c55a4049

https://preview.redd.it/sugub4hipl0e1.png?width=600&format=png&auto=webp&s=b0aa484e8c57728f8b375a0e8d7902464dda2de7

One thing that was surprising to me is that Django-ninja does not appear to be using more memory than the Go implementation.

You check out the updated implementations and the test results here: https://github.com/oscarychen/building-efficient-api

/r/django
https://redd.it/1gq5efh

Читать полностью…

Python Daily

Excel Workbook Refresh Automation

Hey everyone! I’m looking to automate a repetitive task with Python and could use some help. I have a folder full of Excel workbooks that contain queries (linked to an ODBC connection), and I need a program that will:
1. Open each Excel file in the folder one by one.
2. Hit Control + Shift + F5 to refresh all queries in each workbook.
3. Wait until all the queries are done refreshing.
4. Save the workbook.
5. Close it and move to the next file.

Does anyone have suggestions on how to make this happen? I’d appreciate any code snippets or libraries to look into—thanks!

/r/Python
https://redd.it/1gq4aum

Читать полностью…

Python Daily

Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

/r/Python
https://redd.it/1gpzgm9

Читать полностью…

Python Daily

I just learnt how to connect my Django app to mysql

I just connected my django application to mysql database. I feel so proud of me right now.

https://preview.redd.it/kzb1vv1ww11e1.png?width=500&format=png&auto=webp&s=53f2e376d59d5a7d7bbfca7accec6587505fa6fb



/r/django
https://redd.it/1grubxd

Читать полностью…

Python Daily

how to solve this

https://preview.redd.it/psusx618hw0e1.png?width=805&format=png&auto=webp&s=478ec1a14ab79568de8846d85d01909e4943e430

also when i'm switching to new powershell i'm not entering into enviorment

/r/flask
https://redd.it/1gr9u6g

Читать полностью…

Python Daily

Looking for a Django dev to join my remote team

Hey everyone! A while ago I posted a job on this thread and managed to find a great developer. He's still with us, going strong, and I'm looking to expand my team again. I'm hoping this community can deliver again!

The role is for a remote Django developer. I'm open to hiring junior, intermediate, and senior developers. The company is Canadian so you must be fluent in spoken/written English, and Canadian applicants will be preferred over non-Canadians.

Please read more about the job here and follow the instructions to apply:

https://blendable.ca/about-us/careers/full-stack-software-engineer/

/r/django
https://redd.it/1grhjxy

Читать полностью…

Python Daily

Django models reverse relations

Hi there! I was exploring Django ORM having Ruby on Rails background, and one thing really seems unclear.

How do you actually reverse relations in Django? For example, I have 2 models:

class User(models.Model):
// some fields

class Address(models.Model):
user = models.OneToOneField(User, related_name='address')


The issue it that when I look at the models, I can clearly see that Adress is related to User somehow, but when I look at User model, it is impossible to understand that Address is in relation to it.

In Rails for example, I must specify relations explicitly as following:

class User < ApplicationRecord
has_one :address
end

class Address < ApplicationRecord
belongs_to :user
end


Here I can clearly see all relations for each model. For sure I can simply put a comment, but it looks like a pretty crappy workaround. Thanks!

/r/django
https://redd.it/1gr1v69

Читать полностью…

Python Daily

Finding a Django Learning Partner

HI All,

I am in a difficult position in my career with early layoffs and joining at time of recession. Due to all these I have derailed and have been extremely lazy to learn and lack the motivation. I am looking for a partner to learn Django together. Only motive is to share progess and keep each other motivated.

I am good with python and know only some basics of Django. I am a quick learner and academically strong. Preferable partner should be learning Django fully focused. I am a 2022 graduate (if that matters)

Mentors willing to mentor me through this rough phase are appreciated too.

/r/djangolearning
https://redd.it/1gr3z2h

Читать полностью…

Python Daily

Flask 3.1.0 Released

https://flask.palletsprojects.com/en/stable/changes/#version-3-1-0



Drop support for Python 3.8. #5623
Update minimum dependency versions to latest feature releases. Werkzeug >= 3.1, ItsDangerous >= 2.2, Blinker >= 1.9. #5624,5633
Provide a configuration option to control automatic option responses. #5496
Flask.openresource/openinstanceresource and Blueprint.openresource take an encoding parameter to use when opening in text mode. It defaults to utf-8. #5504
Request.max_content_length can be customized per-request instead of only through the MAX_CONTENT_LENGTH config. Added MAX_FORM_MEMORY_SIZE and MAX_FORM_PARTS config. Added documentation about resource limits to the security page. #5625
Add support for the Partitioned cookie attribute (CHIPS), with the SESSIONCOOKIEPARTITIONED config. #5472
-e path takes precedence over default .env and .flaskenv files. load_dotenv loads default files in addition to a path unless load_defaults=False is passed. #5628
Support key rotation with the SECRETKEYFALLBACKS config, a list of old secret keys that can still be used for unsigning. Extensions will need to add support. #5621
Fix how setting host_matching=True or subdomain_matching=False interacts with SERVER_NAME. Setting SERVER_NAME no longer restricts requests to only that domain. #5553
Request.trustedhosts is checked during routing, and can be set through the TRUSTEDHOSTS config. #5636

/r/Python
https://redd.it/1gqjytv

Читать полностью…

Python Daily

uv after 0.5.0 - might be worth replacing Poetry/pyenv/pipx

uv is rapidly maturing as an open-source tool for Python project management, reaching a full-featured capabilities with recent versions 0.4.27 and 0.5.0, making it a strong alternative to Poetry, pyenv, and pipx. However, concerns exist over its long-term stability and licensing, given Astral's venture funding position.

https://open.substack.com/pub/martynassubonis/p/python-project-management-primer-a55

/r/Python
https://redd.it/1gqh4te

Читать полностью…

Python Daily

Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

# Weekly Thread: Professional Use, Jobs, and Education 🏢

Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.

---

## How it Works:

1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.

---

## Guidelines:

- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.

---

## Example Topics:

1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?

---

Let's help each other grow in our careers and education. Happy discussing! 🌟

/r/Python
https://redd.it/1gqriuc

Читать полностью…

Python Daily

JupyterLite Terminal
https://blog.jupyter.org/jupyterlite-terminal-edb3f80dc1c0

/r/IPython
https://redd.it/1gqm6oe

Читать полностью…

Python Daily

have i enterd into enviorment if not ehat can i do ??

https://preview.redd.it/gadg7t6qyo0e1.png?width=381&amp;format=png&amp;auto=webp&amp;s=f238251fa680e60d005fc48aba18ccfe3f235dc7



/r/flask
https://redd.it/1gqg5kr

Читать полностью…

Python Daily

How can I implement email verification in Django?
https://stackoverflow.com/questions/79182908/how-can-i-implement-email-verification-in-django

/r/djangolearning
https://redd.it/1gq3sdm

Читать полностью…

Python Daily

Question for the pros

Hi coders!

I've been made redundant, and so l've decided to take up a new challenge - Python.

Currently reading through: Automate the boring stuff with python by Al Sweigart. ChatGPT recommended this beginners guide as its top choice.

Any tips you could impart on someone getting into the topic? Things you wished you knew at an early stage?


/r/Python
https://redd.it/1gq9qe2

Читать полностью…

Python Daily

The Mill build tool is looking for people to collaborate with on adding Python support

Hi All,

Mill is a build tool traditionally targeting JVM languages Java/Scala/Kotlin, but is branching out to support other languages like multi-module Python or Javascript codebases. We're looking for people interested build tools to collaborate with us on adding first-class Python toolchain support to Mill. To that end, we've put up a non-trivial issue bounty to encourage collaboration for anyone who implements various Python-related build examples and tooling integrations for Mill:

First Class Python Support (4000USD Bounty)

I'd love to get feedback on the tool, the Python support roadmap, or thoughts on what people need from a Python build tool. My own Python tooling experience is a bit out of date, so any feedback (both positive or negative) would be very welcome!

/r/Python
https://redd.it/1gq6d3e

Читать полностью…

Python Daily

help with flask

hello everyone, I don't know much about programming but I'm developing an urban farm application in Flask for my college graduation. Since I don't know much about it, I used AI to help me make everything work correctly, but after everything was ready I realized that the code was not object-oriented, which is a main requirement of my work, so I would like to ask if anyone has free time to take a look at my code and give me guidance on how to make it object-oriented in the simplest way possible. I would be grateful for the help. Thanks

/r/flask
https://redd.it/1gpc81y

Читать полностью…

Python Daily

Displaying human readable choice from a field in a template from a form

this took an incredible amount of time to work through all the kinks and I'm wondering if there was an easier way to do this. I created a form for a profile model to be used for a dating site so a lot of the fields have a list of choices for the possible values. trying to get the human readable values from the choices lists was a challenge since the form will always send the short notation of the choice. even trying to set the default response from the model as the get_FOO display value wasn't working through the template, so i created a template tag that can be called from the template to convert into the display values and went from there. It presented it's own challenges as now the values had to be attained ising the get_field_display method, there was no more if form.status == 2 in my templates it had to be form.instance|get_field_display:'<field name>' and if i wanted to check for null values |default:'' had to be added to the end to force the template to correctly distinguish if a value was null or not. I wanted to show how i was able to get it

/r/django
https://redd.it/1gq4swc

Читать полностью…
Subscribe to a channel