Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
D How was Multi-head Latent Attention not a thing before DeepSeek-V2 came up with it?

Multi-head Latent Attention (MLA) was introduced by DeepSeek-V2 in 2024. The idea is to project keys and values into a latent space and perform attention there, which drastically reduces complexity.

What I don't understand: how did no one propose this earlier? It feels like a pretty natural next step, especially given the trends we’ve seen over the past few years.

For instance, the shift from diffusion in pixel space to latent diffusion (e.g. Stable Diffusion) followed that same principle: operate in a learned latent representation (e.g. through some modern VAE variation) for efficiency. And even in the attention world, Perceiver (https://arxiv.org/abs/2103.03206) in 2021 already explored projecting queries into a latent space to reduce complexity. MLA feels like a very small step from that idea, yet it didn't appear until 2024.

Of course, I know this is a bit of a naive take since in ML research we all know how this goes: in practice, good ideas often don't work out out of the box without "tricks" or nuances. Maybe (probably) someone did try something like MLA years ago, but it just didn't deliver without the right tricks or architecture choices.

So I'm wondering: is that what happened here? Did people experiment with latent attention

/r/MachineLearning
https://redd.it/1oetrex
My Django based open-source project PdfDing is receiving a grant

Hi r/django,

for quite some time I have been working on the open-source project PdfDing - a selfhosted PDF manager, viewer and editor offering a seamless user experience on multiple devices. Last week PdfDing was selected to receive a grant from the NGI Zero Commons Fund. This fund is dedicated to helping deliver, mature and scale new internet commons across the whole technology spectrum and is amongst others funded by the European Commission. The exact sum of the grant still needs to be discussed, but obviously I am very stocked to have been selected and need to share it with the community.

You can find the repository here. As always I would be quite happy about a star and you trying out the application.

/r/django
https://redd.it/1of90vh
Flask-Admin v2.0 released

After more than 1 year of work, Flask-Admin released v2.0 🥳

Flask-Admin solves the boring problem of building an admin interface on top of an existing data model. With little effort, it lets you manage your web service’s data through a user-friendly interface.

https://github.com/pallets-eco/flask-admin/releases/tag/v2.0.0

/r/flask
https://redd.it/1ofn3m4
Creating a migration without changing the model

What would happen if I were to remove a table column and add a new one in a migration, when I only actually added the one column to the model without removing the old one.

Reasoning:
I created a table with an inherited classes and now I want to remove a column but I don’t want to change the actual model class since other tables use it.

/r/django
https://redd.it/1ofb6lg
Staticfiles not being served for Django Admin Panel on cPanel

This is my first time using cPanel for hosting a DRF API, everything worked so far but the admin panel not getting styled although I followed a tuto on Youtube on how to do it and I already used whitenoise but it jsut won't work, the staticfiles are being created but the admin panel is not styled, is there a way where I can at least see some errors or logs ...

/r/django
https://redd.it/1ofwkon
Learning Flask and RESTful API

Please for the love of God tell me how do I learn API oriented Flask? All the tutorials on the internet are just built around web development with hundreds lines of HTML code in them. I don't need that. I want to use Flask to work with APIs and use it as a stepping stone to eventually learn more complex frameworks like FAST API. Please don't recommend Miguel Grinberg tutorial it's a frontend oriented tutorial and only has 1 chapter on databses and 1 chapter on APIs. And please don't post links for documentation. Is there an actual practical way to learn Flask? I don't understand why isn't there a course or a big tutorial on it on the internet?? All I can find relating to Flask is either Grinberg tutorial or a couple of small articles like HOW TO BUILD YOUR API IN 3 LINES OF CODE. How come a framework so popular doesn't have any learning resources on it besides 1 megatutorial and JUST READ THE MANUAL MAN?

/r/flask
https://redd.it/1ofniw8
POS APIs: Custom Integration

Hi everyone!

I am part of a small team that runs a single owned cafe. We are looking to test our own cafe management app (currently the MVP is built with Django and React as I am developing this alone).

I am looking for POS APIs to connect to the Django backend.

The key features I am looking for is:
1. Accept and Log orders to my db (Transactional Info)
2. Basic menu functionalities (add, remove, update pricing, etc.)
3. Query order data to update things like inventory, return, wastage etc., through our already existing custom workflows.
4. Query orders based on private events and/or customer orders (I can create the segments but I need a way of communicating that to the order)

Firstly, I want to know if I am unnecessarily complicating this?

Apologies if this is the wrong place to ask, but any leads on where I can find answers would be helpful.

I have briefly looked at Square, goTab(this ones a bit confusing) and the Toast API but I was not sure if I am locked in to use some fancy cloud system to unlock the actual stuff I need. As our primary goal is to create certain custom KPIs that enable the team to

/r/djangolearning
https://redd.it/1ofy334
Flask-Compress 1.20 released

2 releases were made recently to improve the support of conditional requests.

This should result in better performance when etags are involved (304 not modified instead of 200 OK). Also, Python3.14 is fully supported!



/r/flask
https://redd.it/1ofnpas
Sunday Daily Thread: What's everyone working on this week?

# Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

## How it Works:

1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.

## Guidelines:

Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

## Example Shares:

1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

/r/Python
https://redd.it/1og6hlr
My Python based open-source project PdfDing is receiving a grant

Hi r/Python,

for quite some time I have been working on the open-source project PdfDing - a Django based selfhosted PDF manager, viewer and editor offering a seamless user experience on multiple devices. You can find the repository [here](https://github.com/mrmn2/PdfDing). As always I would be quite happy about a star and you trying out the application.

Last week PdfDing was selected to receive a grant from the [NGI Zero Commons Fund](https://nlnet.nl/news/2025/20251016-selection-NGI0CommonsFund.html). This fund is dedicated to helping deliver, mature and scale new internet commons across the whole technology spectrum and is amongst others funded by the European Commission. The exact sum of the grant still needs to be discussed, but obviously I am very stocked to have been selected and need to share it with the community.

**What My Project Does**

PdfDing's features include:

* Seamless browser based PDF viewing on multiple devices. Remembers current position - continue where you stopped reading
* Stay on top of your PDF collection with multi-level tagging, starring and archiving functionalities
* Edit PDFs by adding comments, highlighting and drawings
* Manage and export PDF highlights and comments in dedicated sections
* Clean, intuitive UI with dark mode, inverted color mode, custom theme colors and multiple layouts
* SSO support via OIDC
* Share PDFs with

/r/Python
https://redd.it/1ogf2iw
I built a Python tool to debug HTTP request performance step-by-step

# What My Project Does

httptap is a CLI and Python library for detailed HTTP request performance tracing.

It breaks a request into real network stages - DNS → TCP → TLS → TTFB → Transfer — and shows precise timing for each.

It helps answer not just “why is it slow?” but “which part is slow?”

You get a full waterfall breakdown, TLS info, redirect chain, and structured JSON output for automation or CI.

🔗 Repo: [github.com/ozeranskii/httptap](https://github.com/ozeranskii/httptap)
📦 PyPI: pypi.org/project/httptap
📕 Documentation: [https://httptap.dev/](https://httptap.dev/)
📹 asciinema: https://asciinema.org/a/751564

# Target Audience

Developers debugging API latency or network bottlenecks
DevOps / SRE teams investigating performance regressions
Security engineers checking TLS setup
Anyone who wants a native Python equivalent of curl -w + Wireshark + stopwatch

httptap works cross-platform (macOS, Linux, Windows), has minimal dependencies, and can be used both interactively and programmatically.

# Comparison

When exploring similar tools, I found two common options:

[reorx/httpstat (Python)](https://github.com/reorx/httpstat) — depends on curl, unmaintained, limited visibility
davecheney/httpstat (Go) — cleaner, but mostly a decorated curl -v, no TLS or JSON export

httptap takes a different route:

Pure Python implementation using httpx and httpcore trace hooks (no curl)
Deep TLS inspection (protocol, cipher, expiry days)
Rich output modes: human-readable table, compact line, metrics-only, and full JSON


/r/Python
https://redd.it/1ogjjrl
Pip 25.3 - build constraints and PEP 517 builds only!

This weekend I got to be the release manager for pip 25.3!

I'd say the the big highlights are:

* A new option `--build-constraint` that allows you to define build time dependency constraints without affecting install constraints.
* Building from source is now PEP 517 only, no more directly calling `setup.py`. This will affect only a tiny % of projects, as PEP 517 automatically falls back to setuptools (but using the official build interface), but it finally removes legacy behavior that tools like uv never even supported.
* Similarly, editable installs are PEP 660 only, pip now no longer calls `setup.py` here either, this does mean if you use editable installs with setuptools you need to use v66+.

A small highlight, but one I'm very happy with, is if your remote index supports PEP 658 metadata (PyPI does), then `pip install --dry-run` and `pip lock` will avoid downloading the entire package.

The official announcement post is at: https://discuss.python.org/t/announcement-pip-25-3-release/104550

The full changelog is at: https://github.com/pypa/pip/blob/main/NEWS.rst#253-2025-10-24

/r/Python
https://redd.it/1og1yzs
How to implement Server Sent Events (SSE) in Django with WSGI

I tried django-eventstream + daphne (ASGI) - it worked, but I've lost hot-reload on server and browser. Then I tried a custom implementation with uvicorn - it worked, but browser hot reload didn't worked anymore, neither server hot reload even though I had --reload flag for uvicorn.

So, I wasted a few hours saving 5 seconds of restarting server and reloading browser after each change and created a new service in Go which takes messages published by Django to redis pub/sub and sends them to frontend. It's basically a new service in a docker-compose file next to your redis service (super lightweight - because is built in Go).

\~2.4 RAM used and it has \~8mb in size.

https://preview.redd.it/ddfqha5t3ixf1.png?width=945&format=png&auto=webp&s=bfd271bd1677e2d047e6060f64ee9cbaeaa84621




Yeah, I could've used pooling, but that setInterval is tricky and I've seen it cause issues in the past.

Here is the repo if anyone is interested:

https://github.com/ClimenteA/go-sse-wsgi-sidecar

/r/django
https://redd.it/1ogs2pw
What's a good host for Django now?

I was planning to use heroku because I thought it was free, but it was not. Are there any good free hosting for django websites right now (if you can tell me the pro and cons that would be good too)? THANK YOU!

It would be nice, if I could also have my databases with the suggestions.

/r/django
https://redd.it/1ogbye8
P Cutting Inference Costs from $46K to $7.5K by Fine-Tuning Qwen-Image-Edit

Wanted to share some learnings we had optimizing and deploying Qwen-Image-Edit at scale to replace Nano-Banana. The goal was to generate a product catalogue of 1.2m images, which would have cost $46k with Nano-Banana or GPT-Image-Edit.

Qwen-Image-Edit being Apache 2.0 allows you to fine-tune and apply a few tricks like compilation, lightning lora and quantization to cut costs.

The base model takes \~15s to generate an image which would mean we would need 1,200,000*15/60/60=5,000 compute hours.

Compilation of the PyTorch graph + applying a lightning LoRA cut inference down to \~4s per image which resulted in \~1,333 compute hours.

I'm a big fan of open source models, so wanted to share the details in case it inspires you to own your own weights in the future.

https://www.oxen.ai/blog/how-we-cut-inference-costs-from-46k-to-7-5k-fine-tuning-qwen-image-edit

/r/MachineLearning
https://redd.it/1ogud3r
寻python+vue项目指导老师,有偿

接了一个学术网站项目
Postgresql数据库
+Django
+Vue
前端后端数据库,代码基本都有了
问题是我第一次接触全栈,没有经验

路由配置,前后端配置不知道哪里有问题,数据库数据获取失败

寻有经验的老师线上指导
详谈
V:G_L_M_H




/r/django
https://redd.it/1ogl0xt
Monday Daily Thread: Project ideas!

# Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

## How it Works:

1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.

## Guidelines:

* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.

# Example Submissions:

## Project Idea: Chatbot

**Difficulty**: Intermediate

**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar

**Description**: Create a chatbot that can answer FAQs for a website.

**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)

# Project Idea: Weather Dashboard

**Difficulty**: Beginner

**Tech Stack**: HTML, CSS, JavaScript, API

**Description**: Build a dashboard that displays real-time weather information using a weather API.

**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)

## Project Idea: File Organizer

**Difficulty**: Beginner

**Tech Stack**: Python, File I/O

**Description**: Create a script that organizes files in a directory into sub-folders based on file type.

**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)

Let's help each other grow. Happy

/r/Python
https://redd.it/1ogzye9
Meta: Limiting project posts to a single day of the week?

Given that this subreddit is currently being overrun by "here's my new project" posts (with a varying level of LLMs involved), would it be a good idea to move all those posts to a single day? (similar to what other subreddits does with Show-off Saturdays, for example).

It'd greatly reduce the noise during the week, and maybe actual content and interesting posts could get any decent attention instead of drowning out in the constant stream of projects.

Currently the last eight posts under "New" on this subreddit is about projects, before the post about backwards compatibility in libraries - a post that actually created a good discussion and presented a different viewpoint.

A quick guess seems to be that currently at least 80-85% of all posts are of the type "here's my new project".

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