Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
My First Project With Python FeedBacks
Hii, i started to student python for 8 moths ago and I finally end my first project, I created a simple crud and would like opinions about my code.
Any feedback for me is very important
github: https://github.com/Kelabr/profindustry
/r/Python
https://redd.it/1lbi5uc
Building an ERP: ready-made platforms vs custom development
I’m a software engineer, and a client has asked me to deliver a fast B2B solution. I’d never heard of Odoo before and I’m curious whether it could really save me time on the infrastructure side. I’m looking for a platform I can customize with my own code and integrations, and so far I’ve shortlisted ERPNext, Odoo, and Axelor as ready-made options.
Long story short, I’m building a portal where electronics suppliers can log in and upload products to the company for which I’m developing the ERP; that company will then resell those items to smaller retailers at a steep discount. Major chains such as Micro Center, Electronic Express, and Abt Electronics will need access as well. The company essentially acts as an intermediary, handling all purchase requests, shipment tracking, and invoicing.
My question: Is it really better to leverage one of these ready-made frameworks, or would building the system from scratch give me a more solid and scalable solution?
/r/Python
https://redd.it/1lb5jk5
Is there a reason for needing to import so many libraries?
Me and a friend are working on a school project for which we **have to** use flask for the backend. I realised that we needed to import a metric fuckton of libraries for buttons, forms and that type of stuff.
Is there a reason for that?
/r/flask
https://redd.it/1lbaaqw
Premier: Instantly Turn Your ASGI App into an API Gateway
Hey everyone! I've been working on a project called Premier that I think might be useful for Python developers who need API gateway functionality without the complexity of enterprise solutions.
## What My Project Does
Premier is a versatile resilience framework that adds retry, cache, throttle logic to your python app.
It operates in three main ways:
1. Lightweight Standalone API Gateway - Run as a dedicated gateway service
2. ASGI App/Middleware - Wrap existing ASGI applications without code changes
3. Function Resilience Toolbox - Flexible yet powerful decorators for cache, retry, timeout, and throttle logic
The core idea is simple: add enterprise-grade features like caching, rate limiting, retry logic, timeouts, and performance monitoring to your existing Python web apps with minimal effort.
### Key Features
- Response Caching - Smart caching with TTL and custom cache keys
- Rate Limiting - Multiple algorithms (fixed/sliding window, token/leaky bucket) that work with distributed applications
- Retry Logic - Configurable retry strategies with exponential backoff
- Request Timeouts - Per-path timeout protection
- Path-Based Policies - Different features per route with regex matching
- YAML Configuration - Declarative configuration with namespace support
### Why Premier
Premier lets you instantly add API gateway features to your existing ASGI applications without introducing heavy, complex tech stacks like Kong or
/r/Python
https://redd.it/1lb52n0
🎉 Update on django-lastdayofmonth integration
Hi everyone!
I recently released **django-lastdayofmonth v1.1.0**, officially tested with **Django 3.2 – 5.2** and **Python 3.10 – 3.12**. The package provides a convenient, database-agnostic ORM function for determining the last day of any month.
The main highlights since the original proposal:
* ✅ **Official Django 5.2 support** (just released!)
* ✅ Simplified usage — no longer requires adding to `INSTALLED_APPS`
* ✅ Fully tested and stable across supported Django and Python versions.
📌 **Link to PyPI:**
[https://pypi.org/project/django-lastdayofmonth/](https://pypi.org/project/django-lastdayofmonth/)
📌 **GitHub Repository:**
[https://github.com/nobilebeniamino/django-lastdayofmonth](https://github.com/nobilebeniamino/django-lastdayofmonth)
I'd still love to see this functionality become a core part of Django, making date calculations easier for everyone.
If you find this feature valuable, please consider showing your support by adding a 👍 reaction to the GitHub issue below:
👉 [**Django Issue #38**](https://github.com/django/new-features/issues/38) 👈
Thanks again for your help and support—let's see if we can make Django even better together! 🚀
/r/django
https://redd.it/1lb1tgk
MCPGex - MCP server for finding, testing and refining regex patterns
Hello,
Wanted to showcase my recently published project, MCPGex, which may be of use to many of you that want to find, test, and refine regex patterns with LLMs.
What My Project Does
MCPGex is an MCP server that allows LLMs to test and validate regex patterns against test cases. It provides a systematic way to develop regex patterns by defining or generating expected outcomes and iteratively testing patterns until all requirements are satisfied. LLMs sometimes fail to capture the correct regex pattern on the first or even second try, so MCPGex allows them to test their regex patterns out.
Target Audience
MCPGex is for anyone who uses regex patterns and would like to have a quick way to generate regex patterns that work. Instead of searching for regex patterns when you forget them, you can ask to have them generated. Of all the regex tasks given thus far, MCPGex has provided the LLM the ability to successfully get the right pattern.
Comparison
As far as I know, there is nothing similar to MCPGex that allows LLMs to test and refine their generated regex patterns. I may be mistaken, and if I am, feel free to correct me! :)
You can go to the project GitHub page by
/r/Python
https://redd.it/1lav4s8
How do I implement rate limiting?
How do I implement rate limiting in my api? Would I have to use redis?
/r/flask
https://redd.it/1lav24s
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/1lauzll
Django Channels
Hi so i need to implement notifications in my application and I have a few questions about Django channel layer(COuld really use some help here):
1. Does every consumer instance get its own channel layer name ? ( lets say i have 2 websocket URLs mapped to 2 consumers , and every client establishes a connection to both these consumers via the url router )
2. Is the channel layer name uniquely generated only for that specific connection ? and therefore might be different if the same consumer spins up another instance of itself for a connection ?
3. How do i store and access these channel layer names for each user when i need to add them to a group or something . Do i just store them in a database for the duration of the connection and get rid of them after ?
/r/django
https://redd.it/1lak6tk
How do you guys secure your django websites?
recently i was working on a freelance project
i wrote a small function for deleting objects but each time i notice that there's something wrong and it was the lack if security and its driving me crazy that each time i have to implement a new security function
so my question is:
How do you guys implement the security features?
do you create all of the security features at once? or wait the production and user feedback?
https://preview.redd.it/lepcn95y5n6f1.png?width=1360&format=png&auto=webp&s=f59125378d9d256b372ad14c3a9c5dc04791b0de
/r/django
https://redd.it/1la9cc8
Pypp: A Python to C++ transpiler WIP. Gauging interest and open to advice.
I am trying to gauge interest in this project, and I am also open to any advice people want to give. Here is the project github: https://github.com/curtispuetz/pypp
# Pypp (a Python to C++ transpiler)
This project is a work-in-progress. Below you will find sections: The goal, The idea (What My Project Does), How is this possible?, The inspiration (Target Audience), Why not cython, pypy, or Nuitka? (Comparison), and What works today?
## The goal
The primary goal of this project is to make the end-product of your Python projects execute faster.
## What My Project Does
The idea is to transpile your Python project into a C++ cmake project, which can be built and executed much faster, as C/C++ is the fastest high-level language of today.
You will be able to run your code either with the Python interpreter, or by transpiling it to C++ and then building it with cmake. The steps will be something like this:
1. install pypp
2. setup your project with cmd: `pypp init`
3. install any dependencies you want with cmd: `pypp install [name\]` (e.g. pypp install numpy)
4. run your code with the python interpreter with cmd: `python my_file.py`
5. transpile your code to C++ with cmd: `pypp transpile`
6. build the C++ code with
/r/Python
https://redd.it/1laf5ss
WTForms SelectField
https://redd.it/1laauir
@pythondaily
JupyterLite 0.6.0 is released! 🎉
https://blog.jupyter.org/jupyterlite-0-6-0-is-released-b4bc69bfc8f4
/r/IPython
https://redd.it/1l9oup2
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/1la1w5g
Website version of Christopher Manson's 1985 puzzle book, "Maze"
This out of print book was from before my time, but Maze: Solve the World's Most Challenging Puzzle by Christopher Manson was a sort of choose-your-own-adventure book that had a $10,000 prize for whoever solved it first. (No one did; the prize was eventually split up among twelve people who got the closest.)
I created a modern, mobile-friendly web version of the book.
GitHub (with Python source): https://github.com/asweigart/mazewebsite
Website: https://inventwithpython.com/mazewebsite/
Start of the maze: https://inventwithpython.com/mazewebsite/directions.html
There are 45 "rooms" in the maze. I created HTML image maps and gathered the text descriptions into a throwaway Python script that generates the html files for the maze. I didn't want it to rely on a database or backend, just HTML, CSS, and a little Bootstrap to make it mobile-friendly. The Python code is in the git repo.
## What My Project Does
Generates HTML files for a web version of Christopher Manson's 1985 puzzle book, "Maze"
## Target Audience
Anyone can view the output website. The Python code may be of interest to people who have similar one-off projects.
## Comparison
The throwaway script spits out html files, making it easy for me to make updates to all 45 pages at once. It's a one-off project that doesn't use other modules, so it's
/r/Python
https://redd.it/1l9urle
Why is Django not the most popular framework?
Python is the most popular programming language with AI/ML becoming centerstage. Then why is Django not the most popular web framework? It seems natural that when models are hosted via API and need a web interface for users, then the Python developers who built the model would opt for Django since it is also in Python.
But I don't see as active an involvement on YouTube for Django compared to Next.js, React, and other Frontend frameworks. Am I misinterpreting it or missing something in my understanding?
I also realised that it's not straightforward to integrate frontend technologies such as Tailwind CSS as it is for other frontend frameworks.
Django has strong security and a fully developed Admin interface which saves lot of development time but still I see that it's not as popular as other frameworks such as Laravel or Next.js.
I am at a point where I need to pick a framework as a goto framework for all my future web development and I am at the moment torn between options and indecisiveness.
I foresee having AI components in my apps and needing to interact with trained models at some point. And I am reluctant if I pick Django,
/r/django
https://redd.it/1lba2to
Local LLM Memorization – A fully local memory system for long-term recall and visualization
Hey r/Python!
I've been working on my first project called LLM Memorization — a fully local memory system for your LLMs, designed to work with tools like LM Studio, Ollama, or Transformer Lab.
The idea is simple: If you're running a local LLM, why not give it a memory?
# What My Project Does
Logs all your LLM chats into a local SQLite database
Extracts key information from each exchange (questions, answers, keywords, timestamps, models…)
Syncs automatically with LM Studio (or other local UIs with minor tweaks)
Removes duplicates and performs idea extraction to keep the database clean and useful
Retrieves similar past conversations when you ask a new question
Summarizes the relevant memory using a local T5-style model and injects it into your prompt
Visualizes the input question, the enhanced prompt, and the memory base
Runs as a lightweight Python CLI, designed for fast local use and easy customization
# Why does this matter?
Most local LLM setups forget everything between sessions.
That’s fine for quick Q&A — but what if you’re working on a long-term project, or want your model to remember what matters?
With LLM Memorization, your memory stays on your machine.
No cloud. No API calls. No privacy concerns. Just a growing personal knowledge
/r/Python
https://redd.it/1lb9fcr
P 3Blue1Brown Follow-up: From Hypothetical Examples to LLM Circuit Visualization
About a year ago, I watched this 3Blue1Brown LLM tutorial on how a model’s self-attention mechanism is used to predict the next token in a sequence, and I was surprised by how little we know about what actually happens when processing the sentence "A fluffy blue creature roamed the verdant forest."
A year later, the field of mechanistic interpretability has seen significant advancements, and we're now able to "decompose" models into interpretable circuits that help explain how LLMs produce predictions. Using the second iteration of an LLM "debugger" I've been working on, I compare the hypothetical representations used in the tutorial to the actual representations I see when extracting a circuit that describes the processing of this specific sentence. If you're into model interpretability, please take a look! https://peterlai.github.io/gpt-circuits/
/r/MachineLearning
https://redd.it/1laqsz2
Recent Noteworthy Package Releases
Over the last 7 days, I've noticed these significant upgrades in the Python package ecosystem.
**NumPy 2.3.0**
**google-adk 1.3.0**
**pip-system-certs 5.0**
**django-multiselectfield 1.0.0**
**shap 0.48.0**
**django-waffle 5.0.0**
**schemathesis 4.0.0**
/r/Python
https://redd.it/1laazsd
My HDR Photo Maker
https://github.com/Coolythecoder/HDR-Photo-Maker is my repo and converts SDR to HDR.
/r/Python
https://redd.it/1laqarr
I built "Submind" – a beautiful PyQt6 app to batch transcribe and auto-translate subtitles
# What My Project Does
**Submind** is a minimal, modern PyQt6-based desktop app that lets you transcribe audio or video files into `.srt` Subtitles using OpenAI’s Whisper model.
🎧 **Features**:
* Transcribe single or multiple files at once (batch mode)
* Optional auto-translation into another language
* Save the original and translated subtitles separately
* Whisper runs locally (no API key required)
* Clean UI with tabs for single/batch processing
It uses the open-source Whisper model ([https://github.com/openai/whisper](https://github.com/openai/whisper)) and supports common media formats like `.mp3`, `.mp4`, `.wav`, `.mkv`, etc.
# Target Audience
This tool is aimed at:
* Content creators or editors who work with subtitles frequently
* Students or educators needing quick lecture transcription
* Developers who want a clean UI example integrating Whisper
* Anyone looking for a fast, local way to convert media to `.srt`
It’s not yet meant for large-scale production, but it’s a polished MVP with useful features for individuals and small teams.
# Comparison
I didn't see any Qt Apps for Whisper yet. Please comment if you have seen any.
# Try it out
GitHub: [rohankishore/Submind](https://github.com/rohankishore/Submind)
Let me know what you think! I'm open to feature suggestions — I’m considering adding drag-and-drop, speaker labeling, and live waveform preview soon. 😄
/r/Python
https://redd.it/1lap8mz
How do I implement rate limiting?
How do I implement rate limiting? Would I have to use redis?
/r/django
https://redd.it/1lav2ko
I built a modern, AI-powered admin for Django using Next.js & shadcn/ui, and I'm looking for contributors!
https://redd.it/1lau7ln
@pythondaily
[Project] I built an open-source tool to turn handwriting into a font using PyTorch and OpenCV.
I'm excited to share HandFonted, a project I built that uses a Python-powered backend to convert a photo of handwriting into an installable .ttf font file.
**Live Demo:** [https://handfonted.xyz](https://www.google.com/url?sa=E&q=https%3A%2F%2Fhandfonted.xyz)
**GitHub Repo:** [https://github.com/reshamgaire/HandFonted](https://github.com/reshamgaire/HandFonted)
**What My Project Does**
HandFonted is a web application that allows a user to upload a single image of their handwritten alphabet. The backend processes this image, isolates each character, identifies it using a machine learning model, and then generates a fully functional font file (.ttf) that the user can download and install on their computer.
**Target Audience**
This is primarily a portfolio project to demonstrate a full-stack application combining computer vision, ML, and web development. It's meant for:
* **Developers and students** to explore how these different technologies can be integrated.
* **Hobbyists and creatives** who want a fun, free tool to create a personal font without the complexity of professional software.
**How it Differs from Alternatives**
While there are commercial services like Calligraphr, HandFonted differs in a few key ways:
* **No Template Required:** You can write on any plain piece of paper, whereas many alternatives require you to print and fill out a specific template.
* **Fully Free & Open-Source:** There are no premium features or sign-ups. The entire codebase is available on GitHub for anyone to inspect, use, or learn from.
* **AI-Powered Recognition:** It
/r/Python
https://redd.it/1laipn1
open-source portfolio website with Django , TailwindCss & Alphin.js
https://redd.it/1la9u38
@pythondaily
SQLAlchemy just the core - but improved - for no-ORM folks
Project: https://github.com/sayanarijit/sqla-fancy-core
What my project does:
There are plenty of ORMs to choose from in Python world, but not many sql query makers for folks who prefer to stay close to the original SQL syntax, without sacrificing security and code readability. The closest, most mature and most flexible query maker you can find is SQLAlchemy core.
But the syntax of defining tables and making queries has a lot of scope for improvement. For example, the table.c.column syntax is too dynamic, unreadable, and probably has performance impact too. It also doesn’t play along with static type checkers and linting tools.
So here I present one attempt at getting the best out of SQLAlchemy core by changing the way we define tables.
The table factory class it exposes, helps define tables in a way that eliminates the above drawbacks. Moreover, you can subclass it to add your preferred global defaults for columns (e.g. not null as default). Or specify custom column types with consistent naming (e.g. created_at).
Target audience:
Production. For folks who prefer query maker over ORM.
Comparison with other projects:
Piccolo: Tight integration with drivers. Very opinionated. Not as flexible or mature as sqlalchemy core.
Pypika: Doesn’t prevent sql injection by default. Hence can be considered insecure.
Raw queries as strings
/r/Python
https://redd.it/1la4yvk
I can't seem to get the flask app with blueprints. Does anyone know how to fix this?
I have a flask app structured similar to this https://github.com/miguelgrinberg/microblog.
Also instead of microblog.py I just called the file run.py
Here is my file-path in the app in powershell.
(my_env) PS C:\\Users\\user\\Downloads\\myapp
The first picture is myapp folder and files within them.
https://imgur.com/a/OUOtQ5N
The second picture is app folder and files within them though I removed some names because I am working on an original idea
https://imgur.com/a/ZBXGnQr
Also am I correct folder and Should I setup my flask app like https://github.com/miguelgrinberg/microblog ?
Here is myapp/config.py.
https://paste.pythondiscord.com/PEHA
Here is my init.py folder in the app folder.
https://paste.pythondiscord.com/YKAQ
Here is models.py
https://paste.pythondiscord.com/IVRA
myapp/run.py
```py
from app import create_app
app = create_app()
```
Here is what I am using to run the flask app
```
$env:FLASK_DEBUG=1
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_ENV='dev'
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_DEBUG=1
(some_env) PS C:\\Users\\user\\Downloads\\myapp> $env:FLASK_APP = "run.py"
(some_env) PS C:\\Users\\user\\Downloads\\myapp> flask run
```
Here is the error and output after I run `flask run`
```py
Usage: flask run [OPTIONS\]
Try 'flask run --help' for help.
Error: While importing 'myapp.app', an ImportError was raised:
Traceback (most recent call last):
File "C:\\Users\\user\\Downloads\\myapp\\my_env\\Lib\\site-packages\\flask\\cli.py", line 245, in locate_app
__import__(module_name)
\~\~\~\~\~\~\~\~\~\~\^\^\^\^\^\^\^\^\^\^\^\^\^
File "C:\\Users\\user\\Downloads\\myapp\\app\\__init__.py", line 17, in <module>
from .models import User
File "C:\\Users\\user\\Downloads\\myapp\\app\\models.py", line 10, in <module>
from ..app import db
ImportError: cannot import name 'db' from partially initialized module 'mylapp.app' (most likely due to
/r/flask
https://redd.it/1la2vuo
Blog: ReThinking Django Template: Part 2
Tired of SVG mess in your Django templates?
My latest post, "ReThinking Django Template: Part 2," dives deep into efficient ways to handle inline SVG icons. From handy packages like heroicons
and dj-svg
to building your own powerful components, I've got solutions to clean up your Django template code and boost reusability.
Ready to make your Django templates much cleaner?
ReThinking Django Template: Part 2
/r/django
https://redd.it/1l9iywe
Productivity Tracker CLI
Hi there!
I've completed a project recently that I would like to share. It is a productivity tracker that allows you to record how much time you spend working on something. Here is a link to it https://github.com/tossik8/tracker.
I made this project because I wanted to improve my time management. Feel free to leave your feedback and I hope some of you find it useful as well!
/r/Python
https://redd.it/1l9re6v
Django statics won't work for admin & drf
Workign on updating my django 4.x to 5.x. I noticed that statics for django admin & drf weren't working.
Solution: Disabled (comment out) django debug toolbar from installed apps and middleware section in settings.py. FYI, I have a local docker compose serving minio s3.
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
os.path.join(BASE_DIR, "media"),
]
# Static files
STATIC_URL = f"{STATIC_URL_BUCKET}/static/" # Or use your public MinIO endpoint
# Media files (user uploads)
MEDIA_URL = "/media/" # Not used for direct serving, but required by Django
/r/django
https://redd.it/1l9xedh