Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
Django Migration rollbacks in production
Hi everybody,
What's everyone's strategy for rolling back migrations in production? Let's assume a bug was not caught in dev or QA, and somehow made it onto production and we need to revert back to stable. How do you handle the migrations that need to be unapplied?
I know you can certainly do it the hard way of manually unapplying for each app, but I'm looking for an automated and scalable way. Thanks for your time!
/r/django
https://redd.it/1l4bk1z
Python Discord Event: Project Show-and-Tell
Python Discord (partnered with r/Python) is excited to announce our first Project Showcase event!
This will be an opportunity for members of the community to do a live show-and-tell of their Python projects in one of our stage channels. If you have a project that you're interested to present, submit it here!
Submitted projects must be written primarily in Python, must have the code in a publicly accessible place such as GitHub, and must not be monetized (excluding donations such as GitHub Sponsors).
The call for proposals will end in 2 days (8th June 04:00 UTC, subject to extension), at which time our staff will look at the submissions and decide which ones will get to present. We'll announce which proposals have been accepted in advance of the event.
The event will take place at 14 June 2025 at 15:00 UTC. We plan to hold future iterations of the event at different times to accommodate different timezones and schedules.
If you wish to demo a project or watch the event live, please make sure you have joined as a member at discord.gg/python! Not all showcases will be recorded!
/r/Python
https://redd.it/1l4c4rn
p99.chat - quickly measure and compare the performance of Python snippets in your browser
Hi, I am Adrien, co-founder of CodSpeed
We just launched p99.chat, a performance assistant in your browser that allows you to quickly measure, visualize and compare the performance of your code in your browser.
It is free to use, the code runs in the cloud, the measurements are done using the pytest-codspeed crate and our runner.
Here is example chat of comparing the performance of bubble sort and quicksort.
Let me know what you think!
/r/Python
https://redd.it/1l3zzn4
django-components v0.140 – Major API improvements, slot-aware caching, and more!
I'm happy to announce [**django-components v0.140**](https://django-components.github.io/django-components/latest/release_notes/#v01400) – our biggest step towards v1 yet! This release brings a ton of improvements, API polish, and some breaking changes, so please read on before upgrading.
We've got django-components to a point where it works really well with GenAI - in a single file you can define the page component, declare its inputs, define user views, or REST API. And to make sure the generated components work well, you can use Pydantic for input validation.
I'm yet to add a section with example to the docs, but that's where we're at.
In the meantime, here's an overview of what's new in [django-components v0.140](https://django-components.github.io/django-components/latest/release_notes/#v01400):
**Highlights:**
* **Overhauled typing system:** Component input types are now defined as class attributes, not generics. This makes your code more readable and aligns with Django’s class-based conventions.
* **Middleware removed:** No more `ComponentDependencyMiddleware`! JS and CSS dependencies are now handled automatically when rendering templates. You can control this with the new `DJC_DEPS_STRATEGY` context key.
* **Slot-aware caching:** Component caching can now (optionally) take slot content into account.
* **Slots API polished:** The slots API is now more robust, with better function signatures, escaping, and metadata. Passing slots as strings, functions, or from templates is now first-class and cache-friendly.
*
/r/django
https://redd.it/1l41xgp
Closing the gap: strict CSP in the Django world | Wagtail CMS
https://wagtail.org/blog/closing-the-gap-strict-csp-compatibility/
/r/django
https://redd.it/1l3u7dq
CBSAnalyzer - Analyze Chase Bank Statement Files
# CBS Analyzer
Hey r/Python! 👋
I just published the first release of a personal project called **CBS Analyzer.** A simple Python library that processes and analyzes Chase Bank statement PDFs. It extracts *both* transaction histories and monthly summaries and turns them into clean, analyzable pandas DataFrames.
# What My Project Does
CBS Analyzer is a fully self-contained tool that:
* Parses one or multiple **Chase** PDF statements
* Outputs structured **DataFrames** for transactions and summaries
* Lets you perform **monthly, yearly, or daily** financial analysis
* Supports exporting to **CSV, Excel, JSON, or Parquet**
* Includes built-in savings rate and cash flow analysis
# 🎯 Target Audience
This is built for:
* People who want insight into their personal finances without manual spreadsheets
* Data analysts, Python learners, or engineers automating financial workflows
* Anyone who uses Chase PDF statements and wants to track patterns
* People who want quick answers towards their financial spending rather paying online subscriptions for it.
# 🆚 Comparison
Most personal finance tools stop at CSV exports or charge monthly fees. CBS Analyzer gives you:
* True Chase PDF parsing: no manual uploads or scraping
* Clean, structured DataFrames ready for analysis or export
* Full transparency and control: all processing is local
* JPMorgan (Chase) stopped the use for
/r/Python
https://redd.it/1l3nc2u
MCGA: A ridiculous Python package that chickens out of tariffs when it's too high
**A ridiculous Python package that chickens out of tariffs when it's too high**
# What the hell is this?
MCGA is a **satirical Python package** that lets you chicken out after setting high tariffs. Set a 120% tariff on numpy? Your import numpy now takes 12 seconds... unless it "chickens out" mid-way and reduces the delay! The higher the tariffs, the higher the probability of chickening out. It's all about the TACO.
It's completely useless
# How it works:
import mcga
# Set some TREMENDOUSLY BEAUTIFUL tariffsmcga.set_tariffs({
"numpy": 145, # 14.5 second delay... or chicken out to 4s!
"pandas": 120, # 12 second delay... 70% chance to chicken out
"requests": 80, # 8 second delay, probably won't chicken out
})
import numpy
# 🐔 Chickening out on numpy
# 🐔 Reduced to 40%
import pandas
/r/Python
https://redd.it/1l3sssl
Is django still worth learning after arise of java dev and mern stack
/r/djangolearning
https://redd.it/1l2l0tq
N Nvidia’s Blackwell Conquers Largest LLM Training Benchmark
New MLPerf training results are in, and Nvidia's Blackwell GPUs continue to dominate across all six benchmarks. That said, the computers built around the newest AMD GPU, MI325X, matched the performance of Nvidia’s H200, Blackwell’s predecessor, on the most popular LLM fine-tuning benchmark.
https://spectrum.ieee.org/mlperf-training-5
/r/MachineLearning
https://redd.it/1l39vua
Using Python 3.14 template strings
https://github.com/Gerardwx/tstring-util/
Can be installed via pip install tstring-util
What my project does
It demonstrates some features that can be achieved with PEP 750 template strings, which will be part of the upcoming Python 3.14 release. e.g.
command = t'ls -l {injection}'
It includes functions to delay calling functions until a string is rendered, a function to safely split arguments to create a list for subprocess.run(, and one to safely build pathlib.Path.
Target audience
Anyone interested in what can be done with t-strings and using types in string.templatelib. It requires Python 3.14, e.g. the Python 3.14 beta.
Comparison
The PEP 750 shows some examples, which formed a basis for these functions.
/r/Python
https://redd.it/1l3it4s
RTime Blindness: Why Video-Language Models Can't See What Humans Can?
Found this paper pretty interesting. None of the models got anything right.
arxiv link: https://arxiv.org/abs/2505.24867
Abstract:
Recent advances in vision-language models (VLMs) have made impressive strides in understanding spatio-temporal relationships in videos. However, when spatial information is obscured, these models struggle to capture purely temporal patterns. We introduce SpookyBench, a benchmark where information is encoded solely in temporal sequences of noise-like frames, mirroring natural phenomena from biological signaling to covert communication. Interestingly, while humans can recognize shapes, text, and patterns in these sequences with over 98% accuracy, state-of-the-art VLMs achieve 0% accuracy. This performance gap highlights a critical limitation: an over-reliance on frame-level spatial features and an inability to extract meaning from temporal cues. Furthermore, when trained in data sets with low spatial signal-to-noise ratios (SNR), temporal understanding of models degrades more rapidly than human perception, especially in tasks requiring fine-grained temporal reasoning. Overcoming this limitation will require novel architectures or training paradigms that decouple spatial dependencies from temporal processing. Our systematic analysis shows that this issue persists across model scales and architectures. We release SpookyBench to catalyze research in temporal pattern recognition and bridge the gap between human and machine video understanding. Dataset and code has been made available on our project website:
/r/MachineLearning
https://redd.it/1l33op4
What should I choose in FE (React + DRF)
I'm planning on working on a new project. However, I haven't decided how I'm going to structure my Front-end. I thought about going with Tanstack Router. Or should I choose something like React Router v7 as framework or Tanstack start. My colleague and I are pretty comfortable with Django and DRF. But we haven't made a final decision about the FE. Any suggestions?
/r/django
https://redd.it/1l33e6u
Mongo Analyser: A TUI Application for MongoDB with Integrated AI Assistant
I’ve made an open-source TUI application in Python called Mongo Analyser that runs right in your terminal and helps you get a clear picture of what’s inside your MongoDB databases.
What My Project Does
Mongo Analyser is a terminal app that connects to MongoDB instances (Atlas or local), scans collections to infer field types and nested document structures, shows collection stats (document counts, indexes, and storage size), and lets you view sample documents. Instead of running db.collection.find()
commands, you can use a simple text UI and even chat with an AI model (currently provided by Ollama, OpenAI, or Google) for schema explanations, query suggestions, etc.
Target Audience
I believe if you’re a Python developer, data engineer, data analyst, or anyone dealing with messy, schema-less data stored in MongoDB, this tool can help you understand what your data actually looks like and how its structure could be improved.
Comparison
Unlike Flask/Django web apps or GUI tools like Compass, Mongo Analyser lives in your terminal, so no web server or browser is needed. Compared to Streamlit or Anvil, you avoid extra dependencies but still get AI-powered insights without a separate backend.
Project's GitHub repository: https://github.com/habedi/mongo-analyser
The project is in the beta stage, and suggestions
/r/Python
https://redd.it/1l36v2r
Whitenoise serving original js files alongside hashed files
Hi, I've been struggling with serving static files in deployment in my django app. It's a simple monolithic architecture using vanilla js for front end. I use nginx to serve the static files and whitenoise to generate the hashed versions into a single directory. The problem is when I check the static folder I see also original files alongside hashed versions and this results in having a multiple event listeners being triggered on the same event and lots of bugs. I found this configuration to avoid copying original files: WHITENOISE_KEEP_ONLY_HASHED_FILES = True
when I set this I see that for some reason only js files that are imported in the html file as script are imported and imports that are required from inside js files are failing. I'm guessing it's looking for original file in the static folder and with this config they don't exist.
Everything is served in one VPS server.
Anyways it's a huge mess, I just hope someone has faced this issue and has a fix.
I'm thinking about using webpack or vite but are not keen on adding 3rd part dependencies if there's a simple fix.
/r/django
https://redd.it/1l300jy
Frontend for backend dev
I've been writing this backend, got to a stage where I need to get a frontend to keep things going, I know just html and css, then I decided to turn to AI to write the front end which is turning out just fine, some include JS which I have absolutely no idea about JS, thw only thing ai write is html and css so far, ive been the one writing the api views myself, it doesn't look bad on a resume as a backend developer when someone is looking at it, or does it?
Is that vibe coding ?
/r/django
https://redd.it/1l2amxg
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/1l4ej2e
Just for fun: looking for Django devs to collaborate on a community-driven open source e-commerce project
Hey everyone!
I'm a Django developer with about 2 years of experience, and I've never created or contributed to an open source project before — so I thought, why not start one with the community?
The idea is simple: build a basic but scalable e-commerce project with Django, just for fun and learning, without relying on large frameworks like Django Oscar. I’ve used Oscar before, and while it’s powerful, it can feel too big, too slow, and a bit overengineered for small to mid-size projects.
So I’m putting together a lightweight, modular e-commerce base that’s easy to understand, extend, and hack on. Something the community can shape and improve over time.
There's no official roadmap yet, just a general goal:
Keep it clean and simple
Make it scalable and flexible
Focus on real-world usability, not overengineering
Learn, share, and have fun with Django
If anyone's interested, just shoot me a message or let me know — happy to have you on board!
/r/djangolearning
https://redd.it/1l45ubr
What are your favorite modern libraries or tooling for Python?
Hello, after a while of having stopped programming in Python, I have come back and I have realized that there are new tools or alternatives to other libraries, such as uv and Polars. Of the modern tools or libraries, which are your favorites and which ones have you implemented into your workflow?
/r/Python
https://redd.it/1l43i8z
How can I deploy my full-stack Flask + MongoDB app on Vercel?
Hey everyone,
I’ve already deployed my Flask back-end successfully, but this is my first time deploying a full-stack app that also includes MongoDB. What steps should I follow to connect my Flask front-end and back-end, configure environment variables on Vercel, and ensure my database operations don’t run into cold-start or timeout issues? Any tips would be much appreciated.
/r/flask
https://redd.it/1l3ziyg
What are the best resources to learn django
/r/djangolearning
https://redd.it/1l2l06a
OpenGrammar (Open Source)
Title: 🖋️ I built an open-source AI grammar checker as an alternative to Grammarly
GitHub Link: https://github.com/muhammadmuneeb007/opengrammar
🚀 OpenGrammar - AI-Powered Writing Assistant & Grammar Checker A free and open-source grammar checking tool that provides real-time writing analysis, style enhancement, and readability metrics using Google's Gemini AI.
🎯 What My Project Does This tool analyzes your writing in real-time to detect grammar errors, suggest style improvements, and provide detailed readability metrics. It offers comprehensive writing assistance without any subscription fees or usage limits.
✨ Key Features
🎯 Real-time grammar and spelling analysis powered by AI
🎨 Style enhancement suggestions and writing improvements
📊 Readability scores (Flesch-Kincaid, SMOG, ARI)
🔤 Smart corrections with one-click acceptance
📚 Synonym suggestions for vocabulary enhancement
📈 Writing analytics including word count and sentence structure
📄 Supports documents up to 10,000 characters
💯 Completely free with no usage restrictions
🆚 Comparison/How is it different from other tools? Most grammar checkers like Grammarly, ProWritingAid, and Ginger require expensive subscriptions ($12-30/month). OpenGrammar leverages Google's free Gemini AI to provide professional-grade grammar checking without any cost, API keys, or account creation required.
🎯 How's the accuracy? OpenGrammar uses Google's advanced Gemini AI model, which provides highly accurate grammar detection and contextual suggestions. The AI understands
/r/Python
https://redd.it/1l3vhc6
Organizing arbitrary languages in the Database
Hi,
i've created several multilingual applications with django, but all content was maintained by editors. Transmeta does a really good job here, and because it is no longer maintained, i forked it and made it usable with python3 and django5.
But now i'm working on a platform that lets users translate their data to arbitrary languages. For example, on a platform like linkedin jobs, i'd like to enter my data once for each language, and create job applications for different languages.
How would you organize this? I don't want to overwhelm the user with i18n fields in forms, i want to give them the opportunity to create their data in specific languages. i.E. somebody that writes their job applications in spanish and english, don't want to add the german localizations.
This looks like i have to craft a custom solution for my case, that allows the user to enter all data simple for their language, and offer a possibility to translate the data to different languages.
Background: It is a platform that displays a users skills, but it also can create job application documents as pdf. And in my experience with job applications all over europe, some companies want english applications, some want applications in
/r/django
https://redd.it/1l3ox55
Need guidance regarding how to become a stack developer
Hey guys I’m an amateur with little to no knowledge on how to become a stack developer. Im good in python and now recently started learning Django .I’m currently pursuing BCA but don’t have anyone to ask about this issue.
Things I wanted to know:
Is there a roadmap as to how to become one?
Good YouTube channels for this
How to sharpen my skills
PLEASE some help or any help would be
Appreciated.
/r/djangolearning
https://redd.it/1l3hure
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/1l3l3gs
Introducing sqlxport: Export SQL Query Results to Parquet or CSV and Upload to S3 or MinIO
In today’s data pipelines, exporting data from SQL databases into flexible and efficient formats like Parquet or CSV is a frequent need — especially when integrating with tools like AWS Athena, Pandas, Spark, or Delta Lake.
That’s where `sqlxport` comes in.
# 🚀 What is sqlxport?sqlxport
is a simple, powerful CLI tool that lets you:
Run a SQL query against PostgreSQL or Redshift
Export the results as Parquet or CSV
Optionally upload the result to S3 or MinIO
It’s open source, Python-based, and available on [PyPI](https://pypi.org/project/sqlxport/).
# 🛠️ Use Cases
Export Redshift query results to S3 in a single command
Prepare Parquet files for data science in DuckDB or Pandas
Integrate your SQL results into Spark Delta Lake pipelines
Automate backups or snapshots from your production databases
# ✨ Key Features
✅ PostgreSQL and Redshift support
✅ Parquet and CSV output
✅ Supports partitioning
✅ MinIO and AWS S3 support
✅ CLI-friendly and scriptable
✅ MIT licensed
# 📦 Quickstart
pip install sqlxport
sqlxport run \
--db-url postgresql://user:pass@host:5432/dbname \
--query "SELECT FROM sales" \
--format parquet \
--output-file sales.parquet
Want to upload it to MinIO or S3?
/r/Python
https://redd.it/1l3edpx
WEP - Web Embedded Python (.wep)
WEP — Web Embedded Python: Write Python directly in HTML (like PHP, but for Python lovers)
Hey r/Python! I recently built and released the MVP of a personal project called WEP — Web Embedded Python. It's a lightweight server-side template engine and micro-framework that lets you embed actual Python code inside HTML using .wep
files and <wep>...</wep>
tags. Think of it like PHP, but using Python syntax. It’s built on Flask and is meant to be minimal, easy to set up, and ideal for quick prototypes, learning, or even building simple AI-powered apps.
# What My Project Does
WEP allows you to write HTML files with embedded Python blocks. You can use the echo()
function to output dynamic content, run loops, import libraries — all inside your .wep
file. When you load the page, Python gets executed server-side and the final HTML is sent to the client. It’s fast to start with, and great for hacking together quick ideas without needing JavaScript, REST APIs, or frontend frameworks.
# Target Audience
This project is aimed at Python learners, hobbyists, educators, or anyone who wants to build server-rendered pages without spinning up full backend/frontend stacks. If you've ever wanted a “just Python and HTML” workflow for demos
/r/Python
https://redd.it/1l35niu
Django security releases issued: 5.2.2, 5.1.10, and 4.2.22
https://www.djangoproject.com/weblog/2025/jun/04/security-releases/
/r/django
https://redd.it/1l36p7f
CarbonKivy - IBM's Carbon Design Components for Kivy
# What My Project Does
CarbonKivy is a Python library that integrates IBM's Carbon Design System with the Kivy framework. It provides a modern, accessible, and user-friendly UI toolkit inspired by Carbon’s design principles, enabling developers to create consistent and visually appealing applications in Kivy. CarbonKivy is a next-generation toolkit for developers looking to create professional-grade applications using the power of Kivy coupled with the design excellence of Carbon Design principles.
Github: CarbonKivy
Demo application: Carbonify
Documentation: CarbonKivy docs
# Target Audience
Its meant for Android, iOS, Windows, Linux and macOS developers.
This can be used for both production and personal projects.
# Comparison
Many of us are aware of KivyMD - Google's Material Design Components for Kivy.
CarbonKivy follows a whole different design system by IBM i.e. the Carbon Design System. This project is in Active Development and will be adding more available components as in the latest Carbon Design System.
Our project follows a whole different strategy and design priciples for more optimized and user friendly experience.
/r/Python
https://redd.it/1l2wwmp
pyleak - detect leaked asyncio tasks, threads, and event loop blocking in Python
What pyleak
Doespyleak
is a Python library that detects resource leaks in asyncio applications during testing. It catches three main issues: leaked asyncio tasks, event loop blocking from synchronous calls (like time.sleep()
or requests.get()
), and thread leaks. The library integrates into your test suite to catch these problems before they hit production.
Target Audience
This is a production-ready testing tool for Python developers building concurrent async applications. It's particularly valuable for teams working on high-throughput async services (web APIs, websocket servers, data processing pipelines) where small leaks compound into major performance issues under load.
The Problem It Solves
In concurrent async code, it's surprisingly easy to create tasks without awaiting them, or accidentally block the event loop with synchronous calls. These issues often don't surface until you're under load, making them hard to debug in production.
Inspired by Go's goleak package, adapted for Python's async patterns.
PyPI: pip install pyleak
GitHub: https://github.com/deepankarm/pyleak
/r/Python
https://redd.it/1l2y5rz
What am I doing wrong? My html page doesn't load the css.
/r/flask
https://redd.it/1l2qld2