Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
Anyone interested in learning Django and Python together
Hey guys I am searching for buddies who can learn and solve problems with me in Python and Django. If you are interested reply me. We will connect and learn together.
/r/django
https://redd.it/1jwqf7f
Non-dev tackling a structured data project — hoping this is the right place to learn + ask
I’m working on building a structured catalog system for vintage and historical trading cards — something like “Sports Reference meets a collector-grade checklist and tagging engine.”
This isn’t just a hobby sketch — I’ve already written a formal standards doc to govern the structure and logic. The schema has been mapped out in a spreadsheet, and I’ve built and tested a good bit of this in Google Sheets, including multiple linked tables and with the largest table housing about 25,000 rows of "generated" data. There’s probably 100+ hours in it already (and that might be conservative).
I’m not a developer, but I’m comfortable thinking in systems, and I’m pretty good at solving problems by reading docs, using AI, or following tutorials. For context:
* I understand data modeling, naming conventions, and relational structures really well
* I’ve dabbled in JavaScript, touched SQL briefly, and built basic websites back in the HTML/CSS days
* I learn best from clear examples and walkthroughs (big fan of YouTube, Ben Collins-style tutorials, etc.)
* This is solo for now, but I’ll bring in help if the project gains traction
* I’m open to no-code/low-code suggestions if you think there’s a better fit than what I’m trying, though I'm concerned about the
/r/django
https://redd.it/1jx707u
I just built a Python project – would love your feedback!
Hey everyone!
I recently finished a small project using Python and wanted to share it with the community. It’s A secure GUI tool for file encryption/decryption using military-grade AES-GCM encryption
You can check it out here: https://github.com/logand166/Encryptor
I’d really appreciate any feedback or suggestions. Also, if you have ideas on how I can improve it or features to add, I’m all ears!
Thanks!
/r/Python
https://redd.it/1jwqh51
Looking for Advice on Learning Django
Hello everyone, I want to learn the Django framework. Do you have any advice on where I should start? Are there any YouTube videos you recommend? Please help me.
/r/djangolearning
https://redd.it/1jx1s53
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/1jx4cik
I made a simple Artificial Life simulation software with python
I made a simple A-Life simulation software and I'm calling it **PetriPixel** — you can create organisms by tweaking their physical traits, behaviors, and other parameters. I'm planning to use it for my final project before graduation.
🔗 GitHub: [github.com/MZaFaRM/PetriPixel](https://github.com/MZaFaRM/PetriPixel)
🎥 Demo Video: [youtu.be/h\_OTqW3HPX8](https://youtu.be/h_OTqW3HPX8)
I’ve always wanted to build something like this with neural networks before graduating — it used to feel super hard. Really glad I finally pulled it off. Had a great time making it too, and honestly, neural networks don’t seem that scary anymore lol. Hope y’all like it too!
* **What My Project Does:** Simulates customizable digital organisms with neural networks in an interactive Petri-dish-like environment.
* **Target Audience:** Designed for students, hobbyists, and devs curious about artificial life and neural networks.
* **Comparison:** Simpler and more visual than most A-Life tools — no config files, just buttons and instant feedback.
P.S. The code’s not super polished yet — still working on it. Would love to hear your thoughts or if you spot any bugs or have suggestions!
/r/Python
https://redd.it/1jwzv2h
[P] A lightweight open-source model for generating manga
https://redd.it/1jws42t
@pythondaily
Building a Text-to-SQL LLM Agent in Python: A Tutorial-Style Deep Dive into the Challenges
Hey r/Python!
Ever tried building a system in Python that reliably translates natural language questions into safe, executable SQL queries using LLMs? We did, aiming to help users chat with their data.
While libraries like litellm
made interacting with LLMs straightforward, the real Python engineering challenge came in building the surrounding system: ensuring security (like handling PII), managing complex LLM-generated SQL, and making the whole thing robust.
We learned a ton about structuring these kinds of Python applications, especially when it came to securely parsing and manipulating SQL – the sqlglot
library did some serious heavy lifting there.
I wrote up a detailed post that walks through the architecture and the practical Python techniques we used to tackle these hurdles. It's less of a step-by-step code dump and more of a tutorial-style deep dive into the design patterns and Python library usage for building such a system.
If you're curious about the practical side of integrating LLMs for complex tasks like Text-to-SQL within a Python environment, check out the lessons learned:
https://open.substack.com/pub/danfekete/p/building-the-agent-who-learned-sql
/r/Python
https://redd.it/1jvyp1o
[P] B200 vs H100 Benchmarks: Early Tests Show Up to 57% Faster Training Throughput & Self-Hosting Cost Analysis
We at Lightly AI recently got early access to Nvidia B200 GPUs in Europe and ran some independent benchmarks comparing them against H100s, focusing on computer vision model training workloads. We wanted to share the key results as they might be relevant for hardware planning and cost modeling.
**TL;DR / Key Findings:**
* **Training Performance:** Observed up to **57% higher training throughput** with the B200 compared to the H100 on the specific CV tasks we tested.
* **Cost Perspective (Self-Hosted):** Our analysis suggests self-hosted B200s could offer significantly lower OpEx/GPU/hour compared to typical cloud H100 instances (we found a potential range of **\~6x-30x cheaper**, details/assumptions in the post). This obviously depends heavily on utilization, energy costs, and amortization.
* **Setup:** All tests were conducted on our own hardware cluster hosted at GreenMountain, a data center running on 100% renewable energy.
The full blog post contains more details on the specific models trained, batch sizes, methodology, performance charts, and a breakdown of the cost considerations:
[https://www.lightly.ai/blog/nvidia-b200-vs-h100](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.lightly.ai%2Fblog%2Fnvidia-b200-vs-h100)
We thought these early, real-world numbers comparing the new generation might be useful for the community. Happy to discuss the methodology, results, or our experience with the new hardware in the comments!
/r/MachineLearning
https://redd.it/1jw3b9b
Anyone successfully combining django with fastapi in production ?
i've been working with django for a few years but recently got interested in fastapi for its async capabilities and pydantic, thinking about a new project where i'd use django for the models/admin and fastapi for the api endpoints.
has anyone actually done this in production? curious about your project structure, any issues with the django orm in async context, and if the performance and dx was worth the setup complexity.
(btw i know django ninja exists, but i prefer tools with wider community adoption)
/r/django
https://redd.it/1jw8qdy
How to properly delete a column in a blue/green deployment?
I just had an unfortunate experience when deploying my app to production. Fortunately I was able to fix it in a minute but still.
Here's what happened:
There's a database field that was never used. Let's call it extra_toppings
. It was added some time ago but no one ever actually used it so I went ahead and deleted it and made the migrations.
Green was active so I deployed to blue. I happened to check green and see that it was a bit screwed up. Fortunately blue was OK so I routed traffic there (I deploy and route traffic as separate actions, so that I can check that the new site is fine before routing traffic to it) and I was OK.
But I went to green to check logs and I saw that it was complaining that field extra_toppings
did not exist. This is despite the fact that it's not used in the code anywhere, I checked.
It seems Django explicitly includes all field names for certain operations like save
and all
.
But so how am I supposed to deploy correctly in blue/green? So far my only answer is to delete the field from the model, but hold off on the migrations, deploy this code,
/r/django
https://redd.it/1jw9o3k
PEP 750 - Template Strings - Has been accepted
https://peps.python.org/pep-0750/
> This PEP introduces template strings for custom string processing.
>
> Template strings are a generalization of f-strings, using a t
in place of the f
prefix. Instead of evaluating to str
, t-strings evaluate to a new type, Template
:
>
> template: Template = t"Hello {name}"
>
> Templates provide developers with access to the string and its interpolated values before they are combined. This brings native flexible string processing to the Python language and enables safety checks, web templating, domain-specific languages, and more.
/r/Python
https://redd.it/1jw71ca
Failing to deploy Flask App in AWS ECR and App Runner
Hello,
I have been trying to deploy my flask backend app by building a docker, pushing it to ECR, and trying to connect to that container from App Runner. My app uses environment variables so I am also manually setting them inside the App Runner. Here is the docker file I am using:
FROM python:3.13
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential && rm -rf /var/lib/apt/lists/*
COPY . /app
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir python-dotenv
EXPOSE 8080
CMD ["python", "app.py"]
I am also specifying my app to listen on all interfaces
app.run(host="0.0.0.0", port=int(os.getenv("PORT", 8080)), debug=True)
However, it keeps failing with this message **Failure** reason : Health check failed.
The app worked when I ran the docker locally so I am confused why this is failing in App Runner. Any suggested fixes?
/r/flask
https://redd.it/1jw4fhb
New Package: Jambo — Convert JSON Schema to Pydantic Models Automatically
🚀 I built **Jambo**, a tool that converts JSON Schema definitions into Pydantic models — dynamically, with zero config!
✅ **What my project does:**
* Takes **JSON Schema** definitions and automatically converts them into **Pydantic** models
* Supports validation for strings, integers, arrays, nested objects, and more
* Enforces constraints like `minLength`, `maximum`, `pattern`, etc.
* Built with AI frameworks like **LangChain** and **CrewAI** in mind — perfect for structured data workflows
🧪 **Quick Example:**
from jambo.schema_converter import SchemaConverter
schema = {
"title": "Person",
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "integer"},
},
"required": ["name"],
}
Person = SchemaConverter.build(schema)
print(Person(name="Alice", age=30))
🎯 **Target Audience:**
* Developers building AI agent workflows with structured data
* Anyone needing to convert schemas into validated models quickly
* Pydantic users who want
/r/Python
https://redd.it/1jw2tih
There was a fundamental mistake in our codebase for years and noone noticed.
I recenctly started working in a new company. I got a ticket to add some feature to our team's main codebase. A codebase which is essential for our work. It included adding some optional binary flag to one of our base agent classes.
Did this, added the option to our agent creator and now is the time to check if my changes work.
Run it with the default value - works perfectly. Now change the default value - doesn't work.
So i started wondering, i see the argument flag (we run them using -- flags) being passed, yet the code i'm expecting to run isn't running.
I put a breakpoint In my new code - The flag is True
while is was supposed to be False
. WTF.
I continue debugging, adding a breakpoint to the __init__
and then i saw the argument is True
. I'm certain that i've passed the correct argument.
I continue debugging, couldn't find the bug at first glance.
We have alot of inheritence, like 6 classes worth of inheritence. Think of:
Base
|
mid1
|
mid2
|
mid3
...
final
So i sat there debugging for a solid hour or two, printing the kwargs, everything looking good untill i tried:
\>>> kwargs[new_arg\]
\>>> KeyError
wtf?
so i looked
/r/Python
https://redd.it/1jvyads
new to django....can i repurpose django-unfold for end users
the django unfold i understand is for admins but i just need to serve a dashboard to end users, since its a saas (b2c), is that possible?
also im very new to django in general, i hear that DRF doesn't support asynchronous. How much of an impact will that have and in what scenarios?
/r/django
https://redd.it/1jxaovb
Trying to dockerize my Django App
I have created docker-compose.yml file, Dockerfile, entrypoint.sh file and .dockerignore file.
Am i missing something?
Also i am unsure if the way i am doing follows best practices. Can someone please go through the files and do let me know if i should change something. It will be helpful. Thanks.
/r/django
https://redd.it/1jwo8z0
Jimmy: Convert your notes to Markdown
Hi! I'm developing [Jimmy](https://github.com/marph91/jimmy), a tool to convert notes from various formats to Markdown.
## What My Project Does
You can convert single files, based on Pandoc, or exports from different note apps (such as [Google Keep](https://marph91.github.io/jimmy/formats/google_keep/), [Synology Note Station](https://marph91.github.io/jimmy/formats/synology_note_station/) and [more](https://marph91.github.io/jimmy/)). The goal is to preserve as much information as possible (note content, tags/labels, images/attachments, links), while being close to the [CommonMark Markdown specification](https://commonmark.org/).
## Features
* **Offline**: There is no online service used to convert the notes. No one will be able to grab your data.
* **Open Source**: See the Github link below.
* **Cross-platform**: Linux, MacOS, Windows
* **Standalone**: It's written in Python, but a single-file executable is provided.
* **No AI**: The code was written without AI assistance and doesn't use AI to convert the notes.
## Target Audience
Anyone who wants to convert their notes to Markdown. For migrating to another note app, further processing in a LLM or simply to keep a backup in a human-readable format.
## Comparison
There are hundreds of scripts that convert from one (note) format to another. Jimmy profits from having a common codebase. Functions can be reused and bugs can be fixed once, which increases code quality.
There are also importers included in note apps. For example [Joplin built-in](https://joplinapp.org/help/apps/import_export/) and
/r/Python
https://redd.it/1jwtq6r
During building a big project for my wife, I accidentally created a SaaS project in Django
It all began with a labor of love for my wife. She needed a platform to share her content—live classes, recorded videos, and more. So I created an MVP for her. Nothing extravagant, just a solid solution that met her needs.
As the platform grew, I had a realization: "This could be valuable for other content creators too." This sparked the development of a more comprehensive product I could offer to others in the content creation space.
During development, I encountered a significant challenge. To enhance user experience, videos uploaded by content creators needed processing into different resolutions. While not technically complex, this required substantial server power. After calculating costs, I discovered I'd need to spend over $10 per customer to handle this locally for my future user base.
This led to my breakthrough idea: Why not build a centralized service that all my customer applications could connect to? And taking it further—why not create something accessible to everyone?
That's how [process.contentor.app](http://process.contentor.app) was born—a developer-friendly SAAS application with:
* A comprehensive API
* Fully remote-to-remote processing
* A generous free tier for you to explore
* Forever free UI tools (mostly for getting some traffic from search engines)
* My personal commitment to continuous improvement
Currently, it integrates with AWS
/r/django
https://redd.it/1jx32nj
Maps with Django⁽³⁾: GeoDjango, Pillow & GPS
https://www.paulox.net/2025/04/11/maps-with-django-part-3-geodjango-pillow-and-gps/
/r/django
https://redd.it/1jwvv5w
Need help to start with django
Hi everyone, I am currently planning to start django and I need some resources ( like youtube playlists) where I could grind the basic foundations very well.
Could anyone share me some resources.
Thank you
/r/djangolearning
https://redd.it/1jwiktj
Readability vs Efficiency
Whenever writing code, is it better to prioritize efficiency or readability? For example, return n % 2 == 1
obviously returns whether a number is odd or not, but return bool(1 & n)
does the same thing about 16% faster even though it’s not easily understood at first glance.
/r/Python
https://redd.it/1jwmuqo
How to internally call Django backend API from Next.js frontend on same EC2 instance? (Getting 404)
Hey folks,
I’ve hosted both my Next.js frontend and Django backend on the same EC2 instance running Amazon Linux. The frontend is accessible via a wildcard subdomain (like subdomain.companyname.in), and I’ve successfully set up SSL for it.
To connect the frontend to the backend, I’ve configured a reverse proxy in Nginx. I added a location /api/ block and I'm proxying requests to the Django backend using a Unix socket.
However, I’m still getting 404 errors on the frontend when it tries to call the API routes.
Any advice or sample configs would be super helpful. Thanks in advance!
/r/django
https://redd.it/1jwj9e8
Python library for making complex projections, and analyzing the result
GitHub: https://github.com/TimoKats/pylan
PyPi: https://pypi.org/project/pylan-lib/
# What My Project Does
Python library for making complex time series projections. E.g. for simulating the combined effect of (increasing) salary, inflation, investment gains, etc, over time. Note, it can also be applied to other domains.
# Target Audience
Data analysts, planners, etc. People that use excel for making projections, but want to move to python.
# Comparison
\- SaaS financial planning tools (like ProjectionLab) work through a webUI, whereas here you have access to all the Python magic in the same place as you do your simulation.
\- Excel....
\- Write your own code for this is not super difficult, but this library does provide a good framework of dealing with various schedule types (some of which cron doesn't support) to get to your analysis more quickly.
/r/Python
https://redd.it/1jw7a04
PSA: You should remove "wheel" from your build-system.requires
A lot of people have a pyproject.toml
file that includes a section that looks like this:
build-system
requires = "setuptools", "wheel"
build-backend = "setuptools.buildmeta"
setuptools is providing the build backend, and wheel used to be a dependency of setuptools, in particular wheel used to maintain something called "bdistwheel".
This logic was moved out of wheel and into setuptools in v70.1.0, and any other dependency that setuptools has on wheel it does by vendoring (copying the code directly).
However, setuptools still uses wheel if it is installed beside it, which can cause failures if you have an old setuptools but a new wheel. You can solve this by removing wheel, which is an unnecessary install now.
If you are a public application or a library I would recommend you use setuptools like this:
build-system
requires = "setuptools >= 77.0.3"
build-backend = "setuptools.buildmeta"
If you are a non-public application I would recommend pinning setuptools to some major version, e.g.
[build-system]
requires = ["setuptools ~= 77.0"]
build-backend = "setuptools.buildmeta"
Also, if you would like a more simple more stable build backend than setuptools check out flit: https://github.com/pypa/flit
If flit isn't feature rich enough for you try hatchling: https://hatch.pypa.io/latest/config/build/#build-system
/r/Python
https://redd.it/1jwbymm
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/1jwclny
Flask google Oauth help meeeeeeeeeeeee
Can someone help me with the google OAuth 2.0 sign in in flask.It's been days and i can't figure it out...........................
/r/flask
https://redd.it/1jwa1t0
Media Without Port
Do anyone experience this issue, image url returns no port
class UserSerializer(serializers.ModelSerializer):
class UserImageSerializer(serializers.ModelSerializer):
class Meta:
model = UserImage
fields = ['id', 'image']
read_only_fields = ['id']
images = UserImageSerializer(many=True, read_only=True, source='user_images')
uploaded_images = serializers.ListField(
child=serializers.ImageField(allow_empty_file=True),
write_only=True,
required=False,
allow_null=True,
default=[]
)
deleted_images = serializers.ListField(
child=serializers.UUIDField(),
write_only=True,
required=False
)
class Meta:
fields = [
/r/django
https://redd.it/1jw591a
What’s new in Django 5.2
https://adamj.eu/tech/2025/04/07/django-whats-new-5.2/
/r/django
https://redd.it/1jvu1to
Creating Vector Embeddings in Python
Wrote up a blog post that I wanted to share on the various different ways you can create vector embedding for when you’re building RAG applications. https://www.datastax.com/blog/how-to-create-vector-embeddings-in-python
Is there any that I missed?
/r/Python
https://redd.it/1jvsm1b