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

Real-time application with Django

lately, I created a helpdesk app, I used Django rest framework and vue js
there is a chat app in this helpdesk and I have to use websocket for a real time experience with the chat
the problem is that I don't really know how I am supposed to do that
I've heard about django channels but I have no idea of how it works
Can somebody explain the role of a consumer, asgi and routing in all of this ?
I'm kinda lost with all this stuff



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

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

Python Daily

PEP 810 – Explicit lazy imports

PEP: https://pep-previews--4622.org.readthedocs.build/pep-0810/

Discussion: https://discuss.python.org/t/pep-810-explicit-lazy-imports/104131

This PEP introduces lazy imports as an explicit language feature. Currently, a module is eagerly loaded at the point of the import statement. Lazy imports defer the loading and execution of a module until the first time the imported name is used.

By allowing developers to mark individual imports as lazy with explicit syntax, Python programs can reduce startup time, memory usage, and unnecessary work. This is particularly beneficial for command-line tools, test suites, and applications with large dependency graphs.

The proposal preserves full backwards compatibility: normal import statements remain unchanged, and lazy imports are enabled only where explicitly requested.

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

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

Python Daily

Looking for a paid/unpaid software engineering internship.

Hey, I'm Youseph Zidan. I'm a Software Engineer with a track record of delivering over 25 freelance projects, including high-performance web scrapers and data pipelines. My practical skills are supported by a strong foundation in core programming principles, which I've honed through both development and teaching Python. For over a year, I have accelerated my growth through intensive mentorship from a Senior Engineer at a leading Silicon Valley tech company, focusing on industry best practices in system design and code architecture. I am eager to apply this unique blend of a builder's mindset, strong fundamentals, and high-level insight to a collaborative engineering team.

I recently developed a solution to a technical challenge I encountered: accurately downloading Street View panoramas. My project, Gspv-dl, is my take on building the most precise and reliable tool for this task.

My personal portfolio website: Portfolio

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

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

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/1nwk7ps

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

Python Daily

Frankenstyle - No-buid, value-driven, fully responsive, utility-first CSS framework.
https://franken.style/

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

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

Python Daily

Where to find clients for a software consulting team?

Hi everyone! 👋
We are a Python team (5–8 developers). We are finishing a big project now and want to start a new one.

Do you know where to find consulting projects or RFPs?

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

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

Python Daily

How safe is building my own login VS using Flask-Login extension?

Someone said that Flask session can be easily hacked via console and, depending on the implementation, they can inject a user's detail to impersonate them. How real is this?

I don't like much Flask-Login, feels limiting and weird... but I might be the one weird for this lol.

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

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

Python Daily

Deep dive into Hosting

Hey folks!

While building my own django project, I spent a lot of time learning the ins and outs of VPS hosting and practical security. I ended up documenting everything I learned in a Medium article and thought it could help others too.

Newcomers: a friendly starting point for your Django hosting on Unmanaged VM.
Veterans: I’d love your suggestions, corrections, and anything I might’ve missed—please tear it apart!

Start here: Deep Dive into Hosting (REST + WebSockets) on an Unmanaged VM — Understanding the ecosystem

ak55073/deep-dive-into-hosting-rest-websockets-on-an-unmanaged-vm-netcup-securing-your-vm-af13cc081abe">Deep Dive into Hosting (REST + WebSockets) on an Unmanaged VM — Securing your VM

ak55073/deep-dive-into-hosting-rest-websockets-on-an-unmanaged-vm-netcup-deploy-services-workers-ff2e4ea39120">Deep Dive into Hosting (REST + WebSockets) on an Unmanaged VM — Deploy: Services & Workers

ak55073/deep-dive-into-hosting-rest-websockets-on-an-unmanaged-vm-netcup-going-live-proxy-https-ea23ebadc51f">Deep Dive into Hosting (REST + WebSockets) on an Unmanaged VM — Going Live: Proxy & HTTPS(ak55073/deep-dive-into-hosting-rest-websockets-on-an-unmanaged-vm-netcup-securing-your-vm-af13cc081abe" rel="nofollow">https://medium.com/@ak55073/deep-dive-into-hosting-rest-websockets-on-an-unmanaged-vm-netcup-securing-your-vm-af13cc081abe)

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

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

Python Daily

D Open source projects to contribute to as an ML research scientist

Hey everyone,
I have a few publications and patents and I work for a tier 2 company as Research scientist. Lately all my job applications have been rejected on the spot. Not even a first interview. I want to beef up my coding skills and be more attractive to employers. Maybe not having a huge github presence is hindering my prospects.

Can u please suggest opensource projects like SGLang or vLLm which I can contribute to? Any starting pointers?

/r/MachineLearning
https://redd.it/1nvvdvl

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

Python Daily

What's the best easy frontend framework for Flašku?

Hi,
we're working on a simple school project about a Cinema reservation systém(you can view upcoming movies, book seats, edit your profile, filter by date/genre, interactive seat selection etc.). It doesnt need to be hyper scalable, so were looking for a nice (pretty/profesionl), easily usable frontend framework to go with backend flask.

Thanks for any suggestion

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

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

Python Daily

D Self-Promotion Thread

Please post your personal projects, startups, product placements, collaboration needs, blogs etc.

Please mention the payment and pricing requirements for products and services.

Please do not post link shorteners, link aggregator websites , or auto-subscribe links.

\--

Any abuse of trust will lead to bans.

Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

\--

Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.

/r/MachineLearning
https://redd.it/1nvrmw5

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

Python Daily

Django security releases issued: 5.2.7, 5.1.13, and 4.2.25
https://www.djangoproject.com/weblog/2025/oct/01/security-releases/

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

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

Python Daily

Logly 🚀 — a Rust-powered, super fast, and simple logging library for Python

What My Project Does

Logly is a logging library for Python that combines simplicity with high performance using a Rust backend. It supports:

Console and file logging
JSON / structured logging
Async background writing to reduce latency
Pretty formatting with minimal boilerplate

It’s designed to be lightweight, fast, and easy to use, giving Python developers a modern logging solution without the complexity of the built-in logging module.



Performance Highlights (v0.1.1)

File Logging (50,000 messages): Python `logging` 0.729s → Logly 0.205s (\~3.5× faster)
Concurrent Logging (4 threads × 25,000 messages): Python logging 3.919s → Logly 0.405s (\~9.7× faster)

Latency Microbenchmark (30,000 messages):

|Percentile|loggingPython |Logly|Speedup|
|:-|:-|:-|:-|
|p50|0.014 ms|0.002 ms|7×|
|p95|0.029 ms|0.002 ms|14.5×|
|p99|0.043 ms|0.015 ms|2.9×|

>



\> Note: Performance may vary depending on your OS, CPU, Python version, and system load. Benchmarks show up to 10× faster performance under high-volume or multi-threaded workloads, but actual results will differ based on your environment.

Target Audience

Python developers needing high-performance logging
Scripts, web apps, or production systems
Developers who want structured logging or async log handling without overhead

Comparison

Python logging: Logly is faster, simpler, and supports async background writing out of the box.
Loguru: Logly adds a Rust-powered backend for improved performance under high-load scenarios and better async file handling.
Structlog: Logly is simpler to

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

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

Python Daily

Flask performance bottlenecks: Is caching the only answer, or am I missing something deeper?

I love Flask for its simplicity and how quickly I can spin up an application. I recently built a small, course-management app with features like user authentication, role-based access control, and PDF certificate generation. It works perfectly in development, but I’m now starting to worry about its performance as the user base grows.
I know the standard advice for scaling is to implement caching—maybe using Redis or Flask-Caching—and to optimize database queries. I've already tried some basic caching strategies. However, I'm finding that my response times still feel sluggish when testing concurrent users.
The deeper issues I'm confronting are:
Gunicorn Workers: I'm deploying with Gunicorn and Nginx, but I'm unsure if I've configured the worker count optimally. What's the best practice for setting the number of Gunicorn workers for a standard I/O-bound Flask app?
External API Calls: In one part of the app, I rely on an external service (similar to how others here deal with Google Sheets API calls. Is the best way to handle this heavy I/O through asynchronous workers like gevent in Gunicorn, or should I be looking at background workers like Celery instead?
Monitoring: Without proper monitoring, it's hard to tell if the bottleneck is the database, my code, or the

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

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

Python Daily

I built Poottu — an offline, privacy-first password manager in Python

Hey everyone — I wanted to share a project I’ve been working on recently: **Poottu**, a desktop password manager written in Python.

# What it does

At its core, Poottu is meant to be a **secure, offline, local vault** for credentials (usernames, passwords, URLs, notes).

* Fully **offline by default** — no telemetry or automatic cloud sync built in
* Clean, minimal GUI (using **PySide6**)
* Groups/categories to organize entries
* Live search across title, username, URL, notes
* Entry preview pane with “show password” option
* Context menu actions: copy username, password, URL, old password, notes
* Timed clipboard clearing (after N seconds) to reduce exposure
* Encrypted backup / restore of vault
* Password generator built in
* Keyboard shortcuts support

# Target audience

Who is Poottu for?

* **Privacy-focused users** who do not want their credentials stored in cloud services by default
* People who prefer **local, device-only control** over their vault
* Those who want a **lightweight password manager** with no vendor lock-in

# Comparison

Most existing password managers fall into two camps: **command-line tools** like `pass` or `gopass`, and **cloud-based managers** like Bitwarden, 1Password, or LastPass.

CLI tools are lightweight and fully offline, but they often feel unintuitive for non-technical users. Cloud-based solutions, on the other hand, are polished and offer seamless cross-device sync, but

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

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

Python Daily

pyya - Simple tool that converts YAML/TOML configuration files to Python objects

New version 0.1.11 is ready, now pyya can convert and validate configuaration from TOML files. In the previous version, I also added a CLI tool to generate stub files from your YAML/TOML configuaration fil, so that tools like mypy can validate type hints and varoius LSPs can autocomplete dynamic attribute-style dictionary. Check README for more info. Contributions/suggestions are welcome as always.

Check GitHub Page: https://github.com/shadowy-pycoder/pyya
Check PyPi Page: https://pypi.org/project/pyya/

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

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

Python Daily

R New paper: LLMs don't have privileged self knowledge, which means we can efficiently train a General Correctness Model to predict the correctness of multiple models. Surprising or expected?

Quick paper highlight (adapted from TLDR thread):
Finds no special advantage using an LLM to predict its own correctness (a trend in prior work), instead finding that LLMs benefit from learning to predict the correctness of many other models – becoming a GCM.
\--
Training 1 GCM is strictly more accurate than training model-specific CMs for all models it trains on (including CMs trained to predict their own correctness).
GCM transfers without training to outperform direct training on OOD models and datasets.
GCM (based on Qwen3-8B) achieves +30% coverage on selective prediction vs much larger Llama-3-70B’s logits.

TLDR thread: https://x.com/hanqi\_xiao/status/1973088476691042527
Full paper: https://arxiv.org/html/2509.24988v1

Discussion Seed:
Previous works have suggested / used LLMs having self knowledge, e.g., identifying/preferring their own generations [https://arxiv.org/abs/2404.13076\], or ability to predict their uncertainty. But paper claims specifically that LLMs don't have knowledge about their own correctness. Curious on everyone's intuition for what LLMs have / does not have self knowledge about, and whether this result fit your predictions.

Conflict of Interest:
Author is making this post.

/r/MachineLearning
https://redd.it/1nwoxqz

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

Python Daily

Help! Flask template variable errors using tojson—const object causing 8 "errors"

Hi all,
I’m making a Flask app that renders an HTML form with JavaScript for interactive coupon discounts. I want to pass a Python object from Flask to my template and use it for calculations in the frontend JS

https://preview.redd.it/f3otwg2qolsf1.png?width=2880&format=png&auto=webp&s=eda8890ac98c3aecbb4ad113e448f1aae4fee3c1



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

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

Python Daily

in html/flask project showing 7 errors

https://preview.redd.it/nlzau30q1msf1.png?width=2880&format=png&auto=webp&s=8cbd8d3ffbd35e5b2a8e3c8247bd2bc495282e3f



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

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

Python Daily

N Stanford is updating their Deep Learning course on YouTube

This is a great opportunity for all ML/DL students/practitioners to either start learning from scratch or filling knowledge gap, time to start learning folks.

/r/MachineLearning
https://redd.it/1nwhihj

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

Python Daily

Django Forms Lifecycle

class ContractItemForm(forms.ModelForm):
product = forms.ModelChoiceField(
queryset=Product.objects.none(), # start with no choices
required=True,
)

class Meta:
model = ContractItem
fields = ['product']

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

# default: empty queryset
self.fields['product'].queryset = Product.objects.none()

# if editing an existing instance, allow that one product
if self.instance and self.instance.pk and self.instance.product_id:


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

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

Python Daily

Snakebar — a tqdm-style progress bar that snakes across your terminal

## What My Project Does
Snakebar is a tqdm-like progress bar for Python. Instead of a plain horizontal bar, it draws a one-character snake that fills your terminal via a random space-filling curve.
It still reports percentage, iterations done, ETA, and rate (it/s), but makes waiting more fun.

## Target Audience
Anyone who runs long scripts, pipelines, or training loops — data scientists, ML engineers, researchers, developers with heavy ETL or simulations.
It’s meant as a lightweight library you can drop in as a direct replacement for tqdm. It’s production-ready but also works fine as a fun toy project in personal scripts.

## Comparison
Compared to tqdm:
- Same semantics (snake_bar works like tqdm).
- Still shows % complete, ETA, and rate.
- Instead of a static bar, progress is visualized as a snake filling the screen.
- Fits automatically to your terminal size.

## Installation

  
pip install snakebar


## Links
- PyPI: https://pypi.org/project/snakebar/
- GitHub: https://github.com/majoburo/snakebar
- License: MIT

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

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

Python Daily

OneCode — Python library to turn scripts into deployable apps

# What My Project Does

OneCode is an open-source Python library that lets you convert your scripts to apps with minimal boilerplate. Using simple decorators/parameters, you define inputs/outputs, and OneCode automatically generates a UI for you.

Github link is here: https://github.com/deeplime-io/onecode

On OneCode Cloud, those same apps can be deployed instantly, with authentication, scaling, and access controls handled for you.

The cloud platform is here: https://www.onecode.rocks/ (free tier includes 3 apps, 1Gb of storage and up to 5 hours of compute).

OneCode allows you to run the same code locally or on the cloud platform (one code ;)). You can connect your github account and automatically sync code to generate the app.

# Target Audience

Python developers who want to share tools without building a web frontend
Data scientists / researchers who need to wrap analysis scripts with a simple interface
Teams that want internal utilities, but don’t want to manage deployment infrastructure
Suitable for production apps (access-controlled, secure), but lightweight enough for prototyping and demos.

# Comparison

Unlike Streamlit/Gradio, OneCode doesn’t focus on dashboards, instead it auto-generates minimal UIs from your function signatures. OneCode cloud is also usable with long running compute, big machines are available, and compute is scalable with the number of users.
Unlike

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

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

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/1nvoqx0

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

Python Daily

Is styling Django Allauth templates really this confusing ?

Or am I doing something wrong ?

I'm new to Django and so far it was a breeze until I got to using Allauth.

I am trying to style my login page and it I seem to be encourtering one problem after the other. I styled the sign in button with Bootstrap 5 and now the the forgot my password link is deformed.

I wouldn't want to go through this headache at all so I'm sure there must be some other way around this ...

Please help.



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

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

Python Daily

Best or most common way to deploy Django web app?

Sometime around 2002 I had a Virtual Private Server (VPS) running Apache with static html files. I started throwing in PHP and JavaScript to make things a little more dynamic. I even had a MySQL DB for when members to login. I got out of the business around 2017.

Now just for fun, I've got another VPS and a little website just to play with. I've ripped all my CDs and want to have a web page (or a few) so anyone can search for songs or artists or albums. I'm only going to open this up to a few friends so I want to control it with login credentials. I've taken Udemy classes on full stack, React, node.js, Django, Docker, PostgreSQL, etc. There are so many choices now!

I plan to write it using Django and using sqlite3 as the DB. I plan to use Bootstrap CSS to make it look pretty. I don't think it will be too tough to make something look pretty good.

Now to deployment. When I've taken the classes, the deployment is always on some website (eg. pythonanywhere.com) and I'm not sure how to duplicate that on my own VPS. I've looked at using Docker

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

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

Python Daily

D Simple Questions Thread

Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

Thanks to everyone for answering questions in the previous thread!

/r/MachineLearning
https://redd.it/1nvalpv

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

Python Daily

Clarifying a few basics on user onboarding experience (engineering wise) (rookie question).

I am trying to build a micro saas tool (backend Django, frontend react, auth using firebase)

During the onboarding I have a specific flow, which I want users to see only for the first time (i.e. when they sign up). I am using firebase for google and apple sign ups.

Question is --> How do I store the "new user" status? It really doesn't make sense to store it as a field in the model, storing it on the client local would not be a good idea either - because if they login from another device or delete cache then they would see the flow again. Any tips on how to handle these decisions? Thanks a lot!

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

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

Python Daily

Watch out for your commas!!!

You might already know the memes behind forgetting to end a line with a semi-colon (;).

And it's kind of funny how Python doesn't fall into this problem.

You should, however, watch out for not ending a line with a comma in this particular scenario.

This scenario being having a list that extends multiple lines vertically.

EXAMPLE_CONST_LIST = [
"main.py", # <------ Make sure there is a trailing comma
"__pycache__"
]


> Python does not throw an error and errors silently

## What Happened to me?
I recently had this issue where I forgot to end an element with a comma. My program wasn't following the logical rules that I wanted it to follow. And this was a simple script, a little script. Nothing fancy, not a HUGE project. Just one file with a few lines:

import os

EXCEPTIONS = [
"main.py" # missing a comma here
"__pycache__"
]

for file in os.listdir():
if file in EXCEPTIONS:
continue

# Rest of logic that I wanted


Notice the missing comma, I couldn't deduce the problem for 3 minutes straight.

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

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

Python Daily

D Monthly Who's Hiring and Who wants to be Hired?

For Job Postings please use this template

>Hiring: [Location\], Salary:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] and [Brief overview, what you're looking for\]

For Those looking for jobs please use this template

>Want to be Hired: [Location\], Salary Expectation:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] Resume: [Link to resume\] and [Brief overview, what you're looking for\]

&#x200B;

Please remember that this community is geared towards those with experience.

/r/MachineLearning
https://redd.it/1nuwj5t

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