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
simple-html 3.0.0 - improved ergonomics and 2x speedup

## What My Project Does
Renders HTML in pure Python (no templates)

## Target Audience
Production

## Comparison
There are similar template-less renderers like dominate, fast-html, PyHTML, htmy. In comparison to those simple-html tends to be:

- more concise
- faster — it's even faster than Jinja (AFAICT it’s currently the fastest library for rendering HTML in Python)
- more fully-typed

## Changes
- About 2x faster (thanks largely to mypyc compilation)
- An attributes dictionary is now optional for tags, reducing clutter.

from simplehtml import h1

h1("hello") # before: h1({}, "hello")

- `int`s, `float`s, and `Decimal` are now accepted as leaf nodes, so you can do


from simple
html import p

p(123) # before: p(str(123))


## Try it out
Copy the following code to example.py:

from flask import Flask
from simplehtml import render, h1

app = Flask(name)

@app.route("/")
def hello
world():
return render(h1("Hello

/r/Python
https://redd.it/1mwc0to
End-user data uploads: separate staging model or staging indicator in a single model?

Wondering what everyone thinks about this: I need a staging area for the data users want to upload. I'm thinking to use a staging model that replicates the prod schema (plus it would have one extra column, the key to identify the owner of staging records). In this case, I'll need to execute SQL to move records from staging to production when ready.

Alternative option is to avoid adding additional model and instead adding a staging indicator column in the single model. But then I worry about indexing and performance.

Thoughts?

/r/django
https://redd.it/1mwdwmp
What is this ??

/r/IPython
https://redd.it/1mwf3ml
Vercel + Railway vs DigitalOcean Droplet for Small E-commerce - Low Maintenance & Cheap?

I’m setting up a small e-commerce site (~20 products) with:

Two Next.js apps (main site + admin panel)

Django backend

Postgres database

Media files (images)


The client doesn’t want a maintenance package, so I’m looking for a solution that is:

- Cheap

- Minimal or zero manual maintenance

- Reliable for low traffic

- Supports persistent storage for images and possibly background tasks (Celery)


I’m debating between:

1. Vercel (Next.js frontends) + Railway (Django + Postgres + volumes)


2. Single DigitalOcean droplet hosting everything



Questions:

Which setup is more “deploy-and-forget” friendly for a small e-commerce site?

Are there hidden maintenance or cost issues I should be aware of?

Anyone running a similar stack - what would you recommend for cheap, low-maintenance hosting?


Thanks in advance!

/r/django
https://redd.it/1mw991o
PrimaryKeyRelatedField - N+1

Someone help, Please
How Can i avoid n+1 in PrimaryKeyRelatedField? Anytime I add student it creates separate query with WHERE clause. Example:
SELECT "content_studentprofile"."id",
"content_studentprofile"."uuid",
"content_studentprofile"."created_at",
"content_studentprofile"."updated_at",
"content_studentprofile"."user_id",
"content_studentprofile"."name"
FROM "content_studentprofile"
WHERE "content_studentprofile"."id" = 11
LIMIT 21


Was not really able to find answer, approach on such cases, So i would be very grateful if someone can help.

/r/django
https://redd.it/1mw4lj2
I built an AI Agent to Auto-Apply Django Jobs


I got tired of the tedious and repetitive job application process.
So I built an AI agent that does the soul-crushing part for me (and you).

---

An end-to-end job-hunting pipeline:

- **Web scraper (70k+ company sites):** Fresh roles, straight from the source.
- **ML matcher (CV → roles):** ranks openings by *fit with your real experience/skills, not keyword bingo.
- **Application agent:** opens a real browser, finds the application page, detects the form, classifies fields (name, email, work history, portfolio, questions…), and fills everything using your CV. Then submits. Repeat.

---
It’s 100% free: [**laboro.co**](https://laboro.co/?utm_source=reddit&utm_medium=organic&utm_contents=87)

/r/django
https://redd.it/1mwpfla
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/1mwrf8z
Doing well with Django advanced topics, but frontend/UI is killing me

Hey everyone,

I’ve been diving deep into Django recently and I’m pretty comfortable with advanced backend topics (middleware, signals, encryption, role-based permissions, logic, etc.). But every time I try to build real-world projects, I hit wall with the frontend/UI side.

I can structure my models, APIs, and business logic pretty cleanly, but when it comes to designing user interfaces (modern, clean, responsive dashboards/forms), I get stuck. Tailwind, Alpine, GSAP, etc. are powerful, but I feel like I’m forcing things together instead of building a polished flow.

How do you guys deal with this:

I’m trying to avoid spending months just on frontend design, but I also don’t want my apps looking half-baked.



/r/django
https://redd.it/1mwq5me
Re-vision, getting more out of YOLO (or any box detection)

Hi everyone,

I wrote this hacky tool after getting annoyed by YOLO missing stuff in my documents.

What my project does:

It detects bboxes with content in documents, using YOLO, it uses multiple YOLO runs.

To solve the problem I faced, you keep the threshold high so anything detected is what the model thinks it is, in every YOLO iteration, it masks out the bboxes found from the image and uses the masked image as input in the next iteration, effectively making the input image simpler for YOLO each iteration while ensuring the boxes are reliable. I've found 2 iterations enough for my use case. This technique will work for all bbox detection models albeit at the cost of more computation, which in YOLO's case wasn't a deal-breaker.

This may not be an original idea, wanted to share it anyway.

Here's the implementation: https://github.com/n1teshy/re-vision

Any ideas/critique would be appreciated.

/r/Python
https://redd.it/1mwp2kw
I built a car price prediction app with Python + C#

Hey,
I made a pet project called AutoPredict – it scrapes real listings from an Italian car marketplace (270k+ cars), cleans the data with Pandas, trains a CatBoost model, and then predicts the market value of any car based on its specs.

The Python backend handles data + ML, while the C# WinForms frontend provides a simple UI. They talk via STDIN/STDOUT.
Would love to hear feedback on the approach and what could be improved!

Repo: https://github.com/Uladislau-Kulikou/AutoPredict

(The auto-moderator is a pain in the ass, so I have to say - target audience: anyone)(https://github.com/Uladislau-Kulikou/AutoPredict)

/r/Python
https://redd.it/1mx2aqc
As much as I love Django, I feel it has fallen way behind compared to Laravel and others

Django has been my favorite framework for years. It’s powerful, reliable, and I honestly feel super productive when I use it. But lately, whenever I look at other ecosystems, I can’t help but feel Django has fallen far behind.

Take Laravel for example: not only does it have a huge community, but the ecosystem is fully supported by the Laravel team itself. You get Forge, Vapor, the new Laravel Cloud, Nova, Laravel Watch, and of course Inertia.js. The experience is so cohesive and integrated. With Django, sure, we have things like HTMX, but let’s be honest — it’s not the same. Inertia + Vue/React brings advantages that Django just doesn’t match out of the box.

And it’s not only Laravel. Look at the Node.js ecosystem:

NestJS gives you a solid API framework with batteries included.
AdonisJS feels like “Laravel for Node,” with everything already integrated so you don’t need to piece together third-party packages.

Meanwhile, Django REST Framework (which I use and like) is still just a library on top of Django rather than something officially baked into the framework.

Don’t get me wrong — Django is still my go-to and I consider it my favorite framework. But whenever I switch over to Laravel,

/r/django
https://redd.it/1mwz8ln
Examples of using UV

I work at a hardware engineering company. I am going to give a talk demoing UV. I am also going to talk about why you should format your project as a package. Any good repos of showcasing the pip workflow vs uv. Any good tutorials or talks i can borrow from.

/r/Python
https://redd.it/1mx53x9
Automatically document SQLAlchemy Databases with Diagrams created with Paracelsus

## What My Project Does

The Paracelsus library automatically generates Entity Relationship Diagrams for SQLAlchemy databases, making it easy to keep documentation up to date with the latest changes in your database.

Diagrams can be created in Mermaid, allowing for easy embedding into Markdown files, or as Dot Diagrams to convert into PNG files.

target audience: anyone

/r/Python
https://redd.it/1mx5xfp
Open source projects using htmx

Do you guys know of any open-source actual projects—not just tutorials—that were created with htmx and Django/Flask?

I want to learn more about the hypermedia approach and see how to use it in real projects.

Suggestions with Unploy or Turbo are welcome, also.



/r/django
https://redd.it/1mx8f10
rovr: a modern, customizable, and aesthetically pleasing terminal file explorer.

source code: https://github.com/nspc911/rovr

what my project does:
- its a file manager in the terminal, made with the textual framework

comparision:
- rovr based on my testing can only compete with superfile.
- as a python project, it cannot compete in performance with yazi at all, nor can it compete with an ncurses focused ranger.
- the main point of rovr was to make it a nice experience in the terminal, and to also have touch support, something that lacked, or just felt weird, when using them

hey guys! just wanted to introduce yall to my latest project, rovr!
rovr is something that stemmed from an issue i faced in superfile which was that threaded rendering wasn't supported yet. back then, i also just discovered textual and really wanted to push its limits.
so after 3 months, and 4 minor releases, here we are! there are quite some issues that i found, hence why i havent given it the major bump, i dont feel safe doing so unlike my other projects.
the documentation is available at https://nspc911.github.io/rovr, I had quite the fun messing around with astro, my first actual web framework.
rovr is extremely customisable. I'm hoping for plugin support soon, but id like to fix as much bugs as possible,

/r/Python
https://redd.it/1mx7zzj
complexipy v4.0: cognitive complexity analysis for Python

Hey everyone,
I'm excited to announce the release of complexipy v4.0.0!
This version brings important improvements to configuration, performance, and documentation, along with a breaking change in complexity calculation that makes results more accurate.

What my project does

complexipy is a high-performance command-line tool and library that calculates the cognitive complexity of Python code. Unlike cyclomatic complexity, which measures how complex code is to test, cognitive complexity measures how difficult code is for humans to read and understand.

Target Audience

complexipy is built for:

- Python developers who care about readable, maintainable code.
- Teams who want to enforce quality standards in CI/CD pipelines.
- Open-source maintainers looking for automated complexity checks.
- Developers who want real-time feedback in their editors or pre-commit hooks.

Whether you're working solo or in a team, complexipy helps you keep complexity under control.

Comparison to Alternatives

To my knowledge, complexipy is still the only dedicated tool focusing specifically on cognitive complexity analysis for Python with strong performance and integrations.
It complements other linters and code quality tools by focusing on a metric that directly impacts code readability and maintainability.

Highlights of v4.0

- Configurable via pyproject.toml: You can now define default arguments in [tool.complexipy] inside pyproject.toml or use a standalone complexipy.toml. This improves workflow consistency and

/r/Python
https://redd.it/1mxbp9i
Complete Python Learning Guide

Hey everyone! 👋

I’ve created a Python Developer Roadmap designed to guide beginners to mid-level learners through a structured path in Python.

If you’re interested, feel free to explore it, suggest improvements, or contribute via PRs!

Check it out here: Python Developer Roadmap

/r/Python
https://redd.it/1mxaxzv
Roadmap to Become Python Developer

Hey everyone! 👋

I’ve created a Python Developer Roadmap designed to guide beginners to mid-level learners through a structured path in Python.

If you’re interested, feel free to explore it, suggest improvements, or contribute via PRs!

Check it out here: Python Developer Roadmap

/r/djangolearning
https://redd.it/1mxaxjn
How do I achieve zero-downtime deployment for my Django app (Gunicorn + Nginx + DigitalOcean)?

I have a django application on DigitalOcean droplets. I’m using Gunicorn, nginx and git actions for deployment . Currently the app is serving 300 rps . How can I deploy without any downtime ?

/r/django
https://redd.it/1mxgvj7
Saturday Daily Thread: Resource Request and Sharing! Daily Thread

# Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

## How it Works:

1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.

## Guidelines:

Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.

## Example Shares:

1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.

## Example Requests:

1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟

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