Just upgraded from Django 5.2.6 to 6.0, admin sidebar filter is now on top :S
I just jump into django 6.0 half an hour ago, my experience so far (actually, short story)
\- I had some issues with "format_html" method, it's usage has changed to deal with XSS attacks so I recommed to read about it previously if you're using it on django 5.x or previous.
\- Django admin works fine but I got an odd issue on filters. My sidebar is no longer on the right handside, it now displays on top just like my laptop is rendering smartphone-like website.
About the first thing, I just needed to refactor some methods on my models to render html properly, not a big deal actually. "format_html" and "mark_safe" are now different and it will need to get the base html with placeholders on the first argument and then a list of arguments to place on the placeholders (obviously!).
Does anyone know how to put the sidebar back again on the right side :) ?
I'm unable to find any info on that topic.
/r/django
https://redd.it/1pgm1hu
I just jump into django 6.0 half an hour ago, my experience so far (actually, short story)
\- I had some issues with "format_html" method, it's usage has changed to deal with XSS attacks so I recommed to read about it previously if you're using it on django 5.x or previous.
\- Django admin works fine but I got an odd issue on filters. My sidebar is no longer on the right handside, it now displays on top just like my laptop is rendering smartphone-like website.
About the first thing, I just needed to refactor some methods on my models to render html properly, not a big deal actually. "format_html" and "mark_safe" are now different and it will need to get the base html with placeholders on the first argument and then a list of arguments to place on the placeholders (obviously!).
Does anyone know how to put the sidebar back again on the right side :) ?
I'm unable to find any info on that topic.
/r/django
https://redd.it/1pgm1hu
Reddit
From the django community on Reddit
Explore this post and more from the django community
I built a Terminal-based GPS with Turn-by-Turn Navigation (using Textual + Rich).
What My Project Does
TermGPS is a terminal-based navigation application (TUI) that provides live turn-by-turn directions. It uses the `Rich` and `Textual` libraries to render a radar-style map, visual signal meters, and a "Co-Pilot" panel that detects your speed (`km/h`) and provides live commentary. It pulls routing data from the OSRM API and supports live GPS tracking (Native CoreLocation on macOS, IP-Geolocation fallback on Linux/Windows)
Target Audience
This is primarily a toy/hobby project for terminal enthusiasts, "ricers" (r/unixporn fans), and developers who want to stay inside their CLI. It is **not** meant for critical real-world navigation (e.g., flying a plane or medical transport) due to current API limitations, but it works great for general city navigation or just looking cool on your second monitor.
Comparison
Unlike `mapscii` (which is a telnet map viewer) or `google-maps-cli` (which often just opens a browser link), TermGPS is a fully interactive, native Python application that runs entirely in your terminal buffer. It doesn't just show a map; it calculates routes, tracks your real-time movement, and has a dedicated UI with themes (Matrix, Dracula, etc.).
Repo & Source: https://github.com/Aditya-Giri-4356/termgps
(Note: Shows "AI-Assisted" in the repo because I pair-programmed this with an AI agent to test TUI rendering limits).
/r/Python
https://redd.it/1pgx1v7
What My Project Does
TermGPS is a terminal-based navigation application (TUI) that provides live turn-by-turn directions. It uses the `Rich` and `Textual` libraries to render a radar-style map, visual signal meters, and a "Co-Pilot" panel that detects your speed (`km/h`) and provides live commentary. It pulls routing data from the OSRM API and supports live GPS tracking (Native CoreLocation on macOS, IP-Geolocation fallback on Linux/Windows)
Target Audience
This is primarily a toy/hobby project for terminal enthusiasts, "ricers" (r/unixporn fans), and developers who want to stay inside their CLI. It is **not** meant for critical real-world navigation (e.g., flying a plane or medical transport) due to current API limitations, but it works great for general city navigation or just looking cool on your second monitor.
Comparison
Unlike `mapscii` (which is a telnet map viewer) or `google-maps-cli` (which often just opens a browser link), TermGPS is a fully interactive, native Python application that runs entirely in your terminal buffer. It doesn't just show a map; it calculates routes, tracks your real-time movement, and has a dedicated UI with themes (Matrix, Dracula, etc.).
Repo & Source: https://github.com/Aditya-Giri-4356/termgps
(Note: Shows "AI-Assisted" in the repo because I pair-programmed this with an AI agent to test TUI rendering limits).
/r/Python
https://redd.it/1pgx1v7
GitHub
GitHub - Aditya-Giri-4356/termgps: a terminal based GPS tool.
a terminal based GPS tool. Contribute to Aditya-Giri-4356/termgps development by creating an account on GitHub.
Multi-tenant with some tenants requiring their own database
I'm building a Django SaaS and need advice on implementing a hybrid multi-tenancy architecture while keeping hosting costs low on AWS/GCP/Azure managed services (like RDS/Cloud SQL and Fargate/Cloud Run).
My Goal:
1. Standard Tenants (90%): Use a Shared PostgreSQL Database with Separate Schemas per Tenant (e.g., using
2. High-Tier Tenants (10%): Require full Database Isolation (Dedicated Database Instance) due to strict compliance needs.
The Key Challenge: How do I best structure the Django application and DevOps pipeline to manage this mix?
The Two Potential Solutions I'm considering are:
A) Single Shared App: Use a custom Django Database Router to route requests to either the shared database (for schema switching) or the dedicated database instance.
B) Dual Deployment: Deploy a separate, dedicated application stack (App Server + DB) for the high-tier customers, leaving the main codebase for the shared schema customers.
Which approach offers the best trade-off between cost savings (for the 90% of tenants) and operational complexity (for managing the whole system)?
/r/django
https://redd.it/1ph76n2
I'm building a Django SaaS and need advice on implementing a hybrid multi-tenancy architecture while keeping hosting costs low on AWS/GCP/Azure managed services (like RDS/Cloud SQL and Fargate/Cloud Run).
My Goal:
1. Standard Tenants (90%): Use a Shared PostgreSQL Database with Separate Schemas per Tenant (e.g., using
django-tenants) to keep costs low.2. High-Tier Tenants (10%): Require full Database Isolation (Dedicated Database Instance) due to strict compliance needs.
The Key Challenge: How do I best structure the Django application and DevOps pipeline to manage this mix?
The Two Potential Solutions I'm considering are:
A) Single Shared App: Use a custom Django Database Router to route requests to either the shared database (for schema switching) or the dedicated database instance.
B) Dual Deployment: Deploy a separate, dedicated application stack (App Server + DB) for the high-tier customers, leaving the main codebase for the shared schema customers.
Which approach offers the best trade-off between cost savings (for the 90% of tenants) and operational complexity (for managing the whole system)?
/r/django
https://redd.it/1ph76n2
Reddit
From the django community on Reddit
Explore this post and more from the django community
Forcing clients to use latest static assets served from S3 storage what are your strategies?
What techniques/strategies do you use to force clients to use the latest css and other changing static assets from S3 compatible storage?
I already separate assets with a development bucket and production bucket, but what is a good way to force clients to use the latest version in the production bucket instead of their cached version?
/r/django
https://redd.it/1pggodf
What techniques/strategies do you use to force clients to use the latest css and other changing static assets from S3 compatible storage?
I already separate assets with a development bucket and production bucket, but what is a good way to force clients to use the latest version in the production bucket instead of their cached version?
/r/django
https://redd.it/1pggodf
Reddit
From the django community on Reddit
Explore this post and more from the django community
Django ORM + Fast API (Guidance)
I'm using FastAPI + Django ORM + Uvicorn in a client project. Everything works fine normally, but if the server is idle for 1–2 weeks, the first request after that fails with:
Interal server error , & found this in my aws log
django.db.utils.InterfaceError: connection already closed
This comes from Django when it tries to open a cursor.
My DB settings:
CONNMAXAGE = 0
CONNHEALTHCHECKS = True
It looks like the database connection goes stale during long idle time, and Django/FastAPI doesn’t recreate it properly.
What’s the correct fix for long-idle Django connections in a FastAPI + Django ORM setup?
Should I increase
/r/django
https://redd.it/1phb920
I'm using FastAPI + Django ORM + Uvicorn in a client project. Everything works fine normally, but if the server is idle for 1–2 weeks, the first request after that fails with:
Interal server error , & found this in my aws log
django.db.utils.InterfaceError: connection already closed
This comes from Django when it tries to open a cursor.
My DB settings:
CONNMAXAGE = 0
CONNHEALTHCHECKS = True
It looks like the database connection goes stale during long idle time, and Django/FastAPI doesn’t recreate it properly.
What’s the correct fix for long-idle Django connections in a FastAPI + Django ORM setup?
Should I increase
CONN_MAX_AGE, call close_old_connections() on each request, or change Uvicorn worker settings?/r/django
https://redd.it/1phb920
Reddit
From the django community on Reddit
Explore this post and more from the django community
Built a SaaS Starter Kit with FastAPI (Auth + Billing + Celery + Stripe) — Looking for feedback!
Hey everyone,
I’ve been working on a SaaS starter kit using FastAPI that bundles together all the core features most products need: authentication, billing, background jobs, clean architecture, and a production-ready stack.
I built this because every new project kept repeating the same boilerplate — so I wanted something modular that could work as a standalone microservice or be integrated directly into any FastAPI project.
GitHub repo: https://github.com/mahmoudsamy7729/fastapi-saas-starter
/r/Python
https://redd.it/1phg3x5
Hey everyone,
I’ve been working on a SaaS starter kit using FastAPI that bundles together all the core features most products need: authentication, billing, background jobs, clean architecture, and a production-ready stack.
I built this because every new project kept repeating the same boilerplate — so I wanted something modular that could work as a standalone microservice or be integrated directly into any FastAPI project.
GitHub repo: https://github.com/mahmoudsamy7729/fastapi-saas-starter
/r/Python
https://redd.it/1phg3x5
GitHub
GitHub - mahmoudsamy7729/fastapi-saas-starter: A complete FastAPI SaaS starter kit with authentication, social login, billing,…
A complete FastAPI SaaS starter kit with authentication, social login, billing, Stripe subnoscriptions, email workflows, and Celery background jobs—built with clean architecture and async SQLAlchemy....
PyCharm 2025.3 released
https://www.jetbrains.com/pycharm/whatsnew/
PyCharm 2025.3: unified edition, remote Jupyter, uv default, new LSP tools (Ruff, Pyright, etc.), smarter data exploration, AI agents + 300+ fixes.
/r/Python
https://redd.it/1phifp4
https://www.jetbrains.com/pycharm/whatsnew/
PyCharm 2025.3: unified edition, remote Jupyter, uv default, new LSP tools (Ruff, Pyright, etc.), smarter data exploration, AI agents + 300+ fixes.
/r/Python
https://redd.it/1phifp4
JetBrains
What's New in PyCharm 2025.3
A unified IDE, support for Jupyter notebooks in remote development, uv as default, proactive data exploration, new LSP tools, Claude Agent, and more!
D Does this NeurIPS 2025 paper look familiar to anyone?
This NeurIPS 2025 paper seems very much like another well-known paper but appears to be renaming everything. Some parts are down to the word matches. Just to make sure I'm not going crazy, as an experiment, I'm not going to post the original paper just to see if others make the connection:
The Indra Representation Hypothesis
https://openreview.net/forum?id=D2NR5Zq6PG
Since comments are asking for the other paper:
The Platonic Representation Hypothesis
https://arxiv.org/abs/2405.07987
/r/MachineLearning
https://redd.it/1phillh
This NeurIPS 2025 paper seems very much like another well-known paper but appears to be renaming everything. Some parts are down to the word matches. Just to make sure I'm not going crazy, as an experiment, I'm not going to post the original paper just to see if others make the connection:
The Indra Representation Hypothesis
https://openreview.net/forum?id=D2NR5Zq6PG
Since comments are asking for the other paper:
The Platonic Representation Hypothesis
https://arxiv.org/abs/2405.07987
/r/MachineLearning
https://redd.it/1phillh
openreview.net
The Indra Representation Hypothesis
Recent studies have uncovered an interesting phenomenon: unimodal foundation models tend to learn convergent representations, regardless of differences in architecture, training objectives, or data...
Opinion on using pyinfra
I recently came across pyinfra and I love it so far. It is way more intuitive than ansible or any of those Cloud DevOps tools. At least for small projects it seems to be the perfect fit and even beyond it I think.
Pyinfra is already around for a while and seems to be well maintained. But I don’t think it has the attention it deserves.
Do you know it? And what is your opinion why to use it / not use it…
Here is the link to the docs: https://pyinfra.com
/r/Python
https://redd.it/1phgso7
I recently came across pyinfra and I love it so far. It is way more intuitive than ansible or any of those Cloud DevOps tools. At least for small projects it seems to be the perfect fit and even beyond it I think.
Pyinfra is already around for a while and seems to be well maintained. But I don’t think it has the attention it deserves.
Do you know it? And what is your opinion why to use it / not use it…
Here is the link to the docs: https://pyinfra.com
/r/Python
https://redd.it/1phgso7
pyinfra
pyinfra - Fast Python Infrastructure Automation Tool
Fast, Python-based infrastructure automation. Deploy to SSH servers, Docker, and local machines. 10x faster than Ansible.
DRF/React security
Hi folks, just reading about the current security vulnerability with server side components and React/Next. As I understand it sends a fake post request and needs to Node to handle the request?
This exploit isn't something that would effect a React/DRF setup, is it? Just want to be 100% sure!
/r/django
https://redd.it/1phg6xq
Hi folks, just reading about the current security vulnerability with server side components and React/Next. As I understand it sends a fake post request and needs to Node to handle the request?
This exploit isn't something that would effect a React/DRF setup, is it? Just want to be 100% sure!
/r/django
https://redd.it/1phg6xq
Reddit
From the django community on Reddit
Explore this post and more from the django community
Turning Django Q2 into a "Headless" Task Queue – I built a REST API wrapper to enable custom dashboards
Hi everyone,
I've been diving deep into **Django Q2** recently. While it's fantastic, I found myself frustrated that I couldn't easily display task status or retry jobs from outside the Django Admin (like in a client-facing React dashboard or a mobile app for ops).
Instead of hardcoding a solution for just one project, I decided to turn it into a learning exercise on how to build and maintain a proper reusable app.
**Introducing** `django-q-monitor`
It’s a plug-and-play DRF wrapper that decouples monitoring from the backend.
**What it does:**
* 📊 **Read-only endpoints:** Lists Tasks and Schedules (JSON formatted).
* 🔄 **Interactive Actions:** POST to `retry` a specific task or DELETE to `cleanup` old history.
* 🛡️ **Security:** Respects DRF permission classes (defaults to `IsAdminUser`, but you can swap it for Token auth).
**Why I'm posting:** This is officially **my first package published on PyPI**. I learned a ton about `pyproject.toml` and packaging standards during the process.
I’ve tried to keep the code clean and strictly typed. I would appreciate any feedback on the **project structure** or suggestions on how to make the **ViewSets** more efficient/extensible.
* **Repo:**[https://github.com/previa1998/django-q-monitor](https://github.com/previa1998/django-q-monitor)
* **PyPI:** `pip install django-q-monitor`
Thanks for checking it out!
/r/django
https://redd.it/1phbccw
Hi everyone,
I've been diving deep into **Django Q2** recently. While it's fantastic, I found myself frustrated that I couldn't easily display task status or retry jobs from outside the Django Admin (like in a client-facing React dashboard or a mobile app for ops).
Instead of hardcoding a solution for just one project, I decided to turn it into a learning exercise on how to build and maintain a proper reusable app.
**Introducing** `django-q-monitor`
It’s a plug-and-play DRF wrapper that decouples monitoring from the backend.
**What it does:**
* 📊 **Read-only endpoints:** Lists Tasks and Schedules (JSON formatted).
* 🔄 **Interactive Actions:** POST to `retry` a specific task or DELETE to `cleanup` old history.
* 🛡️ **Security:** Respects DRF permission classes (defaults to `IsAdminUser`, but you can swap it for Token auth).
**Why I'm posting:** This is officially **my first package published on PyPI**. I learned a ton about `pyproject.toml` and packaging standards during the process.
I’ve tried to keep the code clean and strictly typed. I would appreciate any feedback on the **project structure** or suggestions on how to make the **ViewSets** more efficient/extensible.
* **Repo:**[https://github.com/previa1998/django-q-monitor](https://github.com/previa1998/django-q-monitor)
* **PyPI:** `pip install django-q-monitor`
Thanks for checking it out!
/r/django
https://redd.it/1phbccw
GitHub
GitHub - previa1998/django-q-monitor: REST API monitoring tool for Django Q2 queues.
REST API monitoring tool for Django Q2 queues. Contribute to previa1998/django-q-monitor development by creating an account on GitHub.
How do I fully integrate Xero Accounting with a Django REST Framework backend? Need guidance.
I’m currently building a Django + Django REST Framework project and I want to integrate **Xero Accounting Software** into my backend.
I’m confused about what “full integration” actually means.
Do we *install* Xero somehow in Django, or is everything done only through API calls?
If anyone has:
* tutorials
* code examples
* best practices
* sample projects
* or advice on pitfalls
it would be super helpful.
/r/django
https://redd.it/1phzw8i
I’m currently building a Django + Django REST Framework project and I want to integrate **Xero Accounting Software** into my backend.
I’m confused about what “full integration” actually means.
Do we *install* Xero somehow in Django, or is everything done only through API calls?
If anyone has:
* tutorials
* code examples
* best practices
* sample projects
* or advice on pitfalls
it would be super helpful.
/r/django
https://redd.it/1phzw8i
Reddit
From the django community on Reddit
Explore this post and more from the django community
Tuesday Daily Thread: Advanced questions
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1phsmy3
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1phsmy3
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 413614 members
TIL Python’s random.seed() ignores the sign of integer seeds
I just learned a fun detail about random.seed() after reading a thread by Andrej Karpathy.
In CPython today, the sign of an integer seed is silently discarded. So:
random.seed(5) and random.seed(-5) give the same RNG stream
More generally, +n and -n are treated as the same seed
/r/Python
https://redd.it/1pi7aso
I just learned a fun detail about random.seed() after reading a thread by Andrej Karpathy.
In CPython today, the sign of an integer seed is silently discarded. So:
random.seed(5) and random.seed(-5) give the same RNG stream
More generally, +n and -n are treated as the same seed
/r/Python
https://redd.it/1pi7aso
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
CVPR Submission id changed D
When I logged into my Openreview CVPR author console, I found that my submission id has been changed from 9k+ to 42k+ . Interestingly, the openreview has applied some black colored mask on multiple pages of the pdf, probably to hide original id mentioned at the header in every page. Did anyone else notice that??
/r/MachineLearning
https://redd.it/1phygsa
When I logged into my Openreview CVPR author console, I found that my submission id has been changed from 9k+ to 42k+ . Interestingly, the openreview has applied some black colored mask on multiple pages of the pdf, probably to hide original id mentioned at the header in every page. Did anyone else notice that??
/r/MachineLearning
https://redd.it/1phygsa
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
How Pyrefly Works With Pydantic (Video)
https://www.youtube.com/watch?v=zXYpSQB57YI
Pyrefly now includes experimental support for Pydantic, a popular Python library for data validation and parsing. This feature aims to provide improved static type checking and IDE integration for Pydantic models. In this video we cover the basics of what is supported and how you can start using Pyrefly with your Pydantic code!
This is a reupload, the original one that went up last week had an error
/r/Python
https://redd.it/1piabju
https://www.youtube.com/watch?v=zXYpSQB57YI
Pyrefly now includes experimental support for Pydantic, a popular Python library for data validation and parsing. This feature aims to provide improved static type checking and IDE integration for Pydantic models. In this video we cover the basics of what is supported and how you can start using Pyrefly with your Pydantic code!
This is a reupload, the original one that went up last week had an error
/r/Python
https://redd.it/1piabju
YouTube
How Pyrefly Works with Pydantic (v1 experimental support)
Pyrefly now includes experimental support for Pydantic, a popular Python library for data validation and parsing. This feature aims to provide improved static type checking and IDE integration for Pydantic models. In this video we cover the basics of what…
messaging system within my project
What’s the best way to integrate simple messaging system within my project?
I found out there are a django-messages but not have any support for newer versions of django
Is there any legit easy to install and ready to operate messaging system without the need to instant messages?
/r/django
https://redd.it/1pic5fu
What’s the best way to integrate simple messaging system within my project?
I found out there are a django-messages but not have any support for newer versions of django
Is there any legit easy to install and ready to operate messaging system without the need to instant messages?
/r/django
https://redd.it/1pic5fu
Reddit
From the django community on Reddit
Explore this post and more from the django community
What is the marker of a project root for uv to create the .venv there?
By default
Naively I thought that
Then I learned about uv workspace and discovered of being wrong:
- a workspace is composed by a parent pyproject.toml and many children pyproject.toml.
- the venv and lock file are created only at the parent folder (all the children share the same dependecies)
- the children pyproject.toml do not shows any information about being a member of the workspace
- only the parent pyproject.toml keeps a list of the child members of the workspace.
I tried to ask few AI, but their response is between too generic or wrong ish. I had a look at the source code, but I'm no familiar with rust at all, and there is a lot of it.
I ask because I kinda need the same functionality, find a specific env file at the root of a project, if present. I got it working, but mostly
/r/Python
https://redd.it/1pij98g
By default
uv will create a venv folder at the project root if none is present. During operation also uv is smart enough to find the correct venv if invoked in a sub folder. Naively I thought that
uv, when invoked, would check for a valid pyproject.toml, and the travnverse the tree path upward until it would find one. Then I learned about uv workspace and discovered of being wrong:
- a workspace is composed by a parent pyproject.toml and many children pyproject.toml.
- the venv and lock file are created only at the parent folder (all the children share the same dependecies)
- the children pyproject.toml do not shows any information about being a member of the workspace
- only the parent pyproject.toml keeps a list of the child members of the workspace.
I tried to ask few AI, but their response is between too generic or wrong ish. I had a look at the source code, but I'm no familiar with rust at all, and there is a lot of it.
I ask because I kinda need the same functionality, find a specific env file at the root of a project, if present. I got it working, but mostly
/r/Python
https://redd.it/1pij98g
docs.astral.sh
Settings | uv
uv is an extremely fast Python package and project manager, written in Rust.
I built a local first tool that uses AST Parsing + Shannon Entropy to sanitize code for AI
I keep hearing about how people are uploading code with personal/confidential information.
So, I built ScrubDuck. It is a local first Python engine, that sanitizes your code before you send it to AI and then can restore the secrets when you paste AI's response back.
What My Project Does (Why it’s not just Regex):
I didn't want to rely solely on pattern matching, so I built a multi-layered detection engine:
1. AST Parsing (
2. Shannon Entropy: It calculates the mathematical randomness of string tokens. This catches API keys that don't match known formats (like generic random tokens) by flagging high-entropy strings.
3. Microsoft Presidio: I integrated Presidio’s NLP engine to catch PII like names and emails in comments.
4. Context-Aware Placeholders: It swaps secrets for tags like
How it works (Comparison):
1. Sanitize: You highlight code -> The Python noscript analyzes it locally -> Swaps secrets for placeholders -> Saves a map in memory.
2.
/r/Python
https://redd.it/1piick8
I keep hearing about how people are uploading code with personal/confidential information.
So, I built ScrubDuck. It is a local first Python engine, that sanitizes your code before you send it to AI and then can restore the secrets when you paste AI's response back.
What My Project Does (Why it’s not just Regex):
I didn't want to rely solely on pattern matching, so I built a multi-layered detection engine:
1. AST Parsing (
ast module): It parses the Python Abstract Syntax Tree to understand context. It knows that if a variable is named db_password, the string literal assigned to it is sensitive, even if the string itself ("correct-horse-battery") looks harmless.2. Shannon Entropy: It calculates the mathematical randomness of string tokens. This catches API keys that don't match known formats (like generic random tokens) by flagging high-entropy strings.
3. Microsoft Presidio: I integrated Presidio’s NLP engine to catch PII like names and emails in comments.
4. Context-Aware Placeholders: It swaps secrets for tags like
<AWS_KEY_1> or <SECRET_VAR_ASSIGNMENT_2>, so the LLM understands what the data is without seeing it.How it works (Comparison):
1. Sanitize: You highlight code -> The Python noscript analyzes it locally -> Swaps secrets for placeholders -> Saves a map in memory.
2.
/r/Python
https://redd.it/1piick8
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Template repo with uv, ruff, pyright, pytest (with TDD support) + CI and QoL Makefile
I've been using python from big monorepos to quick noscripts for a while now and landed on this (fairly opinionated) spec to deal with the common issues primarily around the loose type system.
Aims to not be too strict to facilitate quick iterations, but strict enough to enforce good patterns and check for common mistakes. TDD support with
- Sensible defaults for
- Basic
-
- Makefile with standardised commands like
Anyone looking for template
Beginners looking for a "ready to go" base that enforces best-practices.
> Quite nice together with claude code or agentic workflows - make them run
---
Repo here
Same (outdated) concept
/r/Python
https://redd.it/1pi4rmg
I've been using python from big monorepos to quick noscripts for a while now and landed on this (fairly opinionated) spec to deal with the common issues primarily around the loose type system.
Aims to not be too strict to facilitate quick iterations, but strict enough to enforce good patterns and check for common mistakes. TDD support with
pytest-watch + uv for fast dependency management.- Sensible defaults for
ruff and pyright out of the box configured in pyproject.toml- Basic
uv directory structure, easy to use from quick hacks to published packages-
make watch <PATH> the main feature here - great for TDD, run in a background terminal and by the time you look over/tab tests have re-run for you.- Makefile with standardised commands like
make sync (dependencies) and other QoL.Anyone looking for template
uv repo structures, integrating ruff, pyright and pytest with CI.Beginners looking for a "ready to go" base that enforces best-practices.
> Quite nice together with claude code or agentic workflows - make them run
make check and make test after any changes and it tends to send them in a loop that cleans up common issues. Getting a lot more out of claude code this way.---
Repo here
Same (outdated) concept
/r/Python
https://redd.it/1pi4rmg
GitHub
GitHub - idatsy/python-base-uv: Python project template with default config and CI for uv
Python project template with default config and CI for uv - idatsy/python-base-uv