Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Customizing your IPython shell in Docker and Docker Compose

Hi everyone,

I avoided customizing IPython at all in Docker Compose environments because I didn't want to impose my preferences and proclivities on my coworkers. But it turns out it's easy to customize without having to do that.

In this post: https://frankwiles.com/posts/customize-ipython-docker/

I walk you through:

* How to use a local profile in Docker Compose
* How to set simple configuration options (vi editing mode)
* Automatically import frequently used libraries
* Load project specific data you need frequently
* How to build powerful custom debugging tools

Hope you find it useful! Welcome any feedback you might have.

/r/Python
https://redd.it/1mv2wut
Inspiration Tuesday

Things are a little slow this week, so why don’t we spice things up and talk about what we are all working on! Be it a learning project, a passion project, or something else!

/r/djangolearning
https://redd.it/1muo3ec
Complete beginner: How to deploy Django app to Windows Server?

Hi everyone!
I built a Django app on my MacBook that works fine locally, but I'm completely new to deployment and need to get it running on a Windows Server in our office.

Current situation:
\- Django app works with `python manage.py runserver` on macOS
\- Need to deploy to Windows Server (not cloud)
\- Zero deployment experience
\- Uses PostgreSQL, static files, and a requirements.txt
What I'm lost on:
\- How to transfer my code to Windows Server?
\- What do I install on the server to run Django?
\- How to make it accessible to others on our network?
\- Do I need IIS or something else?
\- How to handle the database and static files?

/r/django
https://redd.it/1mv5n2e
Looking for a Django library to build OAuth Server (in CSR settings)

Do you know a Django library for building OAuth server which supports DRF? django-oauth-toolkit seems only to support Django "forms" for OAuth consent screen. I have a separated frontend (CSR). Authorize endpoint should redirect to frontend instead of rendering a consent screen.

/r/django
https://redd.it/1mvagx9
Wove: Beautiful Python async

Hi all! I've released a new python library that rethinks async coding, making it more concise and easier to read. Check it out and let me know what you think!

[https://github.com/curvedinf/wove/](https://github.com/curvedinf/wove/)

# What My Project Does

Here are the first bits from the github readme:

# Core Concepts

Wove is made from sensical philosophies that make async code feel more Pythonic.

* **Looks Like Normal Python**: You write simple, decorated functions. No manual task objects, no callbacks.
* **Reads Top-to-Bottom**: The code in a `weave` block is declared in a logical order, but `wove` intelligently determines the optimal *execution* order.
* **Automatic Parallelism**: Wove builds a dependency graph from your function signatures and runs independent tasks concurrently.
* **Normal Python Data**: Wove's task data looks like normal Python variables because it is, creating inherent multithreaded data safety in the same way as map-reduce.
* **Minimal Boilerplate**: Get started with just the `async with weave() as w:` context manager and the `@w.do` decorator.
* **Sync & Async Transparency**: Mix `async def` and `def` functions freely. `wove` automatically runs synchronous functions in a background thread pool to avoid blocking the event loop.
* **Zero Dependencies**: Wove is pure Python, using only the standard library and can be integrated into any Python project.

# Installation

Download wove

/r/Python
https://redd.it/1mv4tyb
Websockets in django

I want to understand what are websockets and what are they mainly used for ??

for example rest apis fetch data from backend to serve front-end, what a typical use case for web sockets in a simple webapp.

also how to implement them in django. Do they integrate with django models in any sense ??

what components of django interact with them and maybe some small boilerplate code to help me understand what to do with web socket and how would be great and appreciated.


Thanks

/r/django
https://redd.it/1mvby4o
[P] My open-source project on building production-level AI agents just hit 10K stars on GitHub

My Agents-Towards-Production GitHub repository just crossed 10,000 stars in only two months!

Here's what's inside:

* 33 detailed tutorials on building the components needed for production-level agents
* Tutorials organized by category
* Clear, high-quality explanations with diagrams and step-by-step code implementations
* New tutorials are added regularly
* I'll keep sharing updates about these tutorials here

A huge thank you to all contributors who made this possible!

[Link to the repo](https://github.com/NirDiamant/agents-towards-production)

/r/MachineLearning
https://redd.it/1mvhpu6
How to Logout Everywhere (Clear All Sessions)?

Hi,

What’s the best way to add a button that lets a user log out of their account everywhere (basically clear all their active sessions)?

Looping through every session like this is terrible for performance:

for s in Session.objects.all():
if s.getdecoded().get("authuserid") == str(user.id):
s.delete()

I also found this package, but it looks unmaintained and possibly insecure:
https://github.com/jazzband/django-user-sessions

How should I implement this properly?

Thanks!

/r/django
https://redd.it/1muw5hy
R What do people expect from AI in the next decade across various domains? Survey with N=1100 people from Germay::We found high likelihood, higher perceived risks, yet limited benefits low perceived value. Yet, benefits outweight risks in forming value judgments. Visual result illustrations :)

Hi everyone, we recently published a peer-reviewed article exploring how people perceive artificial intelligence (AI) across different domains (e.g., autonomous driving, healthcare, politics, art, warfare). The study used a nationally representative sample in Germany (N=1100) and asked participants to evaluate 71 AI-related scenarios in terms of expected likelihood, risks, benefits, and overall value.

If you like AI or studying the public perception of AI, please also give us an upvote here: https://www.reddit.com/r/science/comments/1mvd1q0/public\_perception\_of\_artificial\_intelligence/ 🙈

Main takeaway: People often see AI scenarios as likely, but this doesn’t mean they view them as beneficial. In fact, most scenarios were judged to have high risks, limited benefits, and low overall value. Interestingly, we found that people’s value judgments were almost entirely explained by risk-benefit tradeoffs (96.5% variance explained, with benefits being more important for forming value judgements than risks), while expectations of likelihood didn’t matter much.

Why this matters? These results highlight how important it is to communicate concrete benefits while addressing public concerns. Something relevant for policymakers, developers, and anyone working on AI ethics and governance.

If you’re interested, here’s the full article:
Mapping Public Perception of Artificial Intelligence: Expectations, Risk-Benefit Tradeoffs, and Value As Determinants for Societal

/r/MachineLearning
https://redd.it/1mvmlbw
Zypher: A Modern GUI for yt-dlp Built with Python and CustomTkinter

Hi everyone!

I'm sharing my project Zypher, a desktop GUI wrapper for yt-dlp built with Python and CustomTkinter.

# What My Project Does

Zypher simplifies downloading video and audio content from hundreds of websites. It provides a clean, modern interface that leverages the power of the yt-dlp command line tool without requiring users to touch a terminal. You just paste a URL, click a button, and your download starts. The current stable version (Zypher Lite) focuses on speed and reliability by downloading in native formats without external dependencies like FFmpeg.

# Target Audience

This is a tool for end-users who want a simple, GUI-driven alternative to command-line tools like yt-dlp or youtube-dl. It's also relevant for Python developers interested in seeing practical applications of GUI development with CustomTkinter, packaging, and integrating powerful libraries into a user-friendly product. The Lite version is production ready for basic use, while the full version is a work in progress project.

# Comparison

Unlike the official yt-dlp which is command-line only, Zypher provides a full graphical interface. It differs from many web-based downloaders by being a local, private Windows application with no ads, no trackers, and no upload limits. Compared to other GUI wrappers, its focus is on a modern, clean UI

/r/Python
https://redd.it/1mvpqx0
Python workflows for efficient text data labeling in NLP projects?

For those working with NLP in Python, what’s your go-to way of handling large-scale text labeling efficiently?

Do you rely on:

* Pure manual labeling with Python-based tools (e.g., Label Studio, Prodigy),
* Active Learning frameworks (modAL, small-text, etc.),
* Or custom batching/heuristics you’ve built yourself?

Curious what Python-based approaches people actually find practical in real projects, especially where accuracy vs labeling cost becomes a trade-off.

/r/Python
https://redd.it/1mvhq51
Implemented a Production-Ready Soft Delete System Using Django Custom User Model – Feedback Welcome

Hey everyone,

I recently built a **soft delete system for users** in a Django-based financial application and thought I’d share the details in case it helps others.

In production systems—especially in finance or regulated sectors—you often can’t just delete a user from the database. Audit trails, transaction records, and compliance needs make this much trickier. We needed something that was:

* Reversible
* Audit-friendly
* Easy to work with in admin
* Compatible with Django's auth and related models

🔧 **Key Design Choices:**

* Custom `User` model from day one (don’t wait until later!)
* Soft delete via `is_deleted`, `deleted_at`, `deleted_by`
* `on_delete=models.PROTECT` to keep transaction history safe
* Admin actions for soft deleting and restoring users
* Proper indexing for `is_deleted` to avoid query slowdowns

🔎 Here's the full write-up (with code and reasoning):
👉 [https://open.substack.com/pub/techsavvyinvestor/p/how-we-built-a-soft-delete-system?r=3ng1a9&utm\_campaign=post&utm\_medium=web&showWelcomeOnShare=true](https://open.substack.com/pub/techsavvyinvestor/p/how-we-built-a-soft-delete-system?r=3ng1a9&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true)

Would love feedback, especially from folks who’ve implemented this at scale or found better patterns. Always open to improvements.

Thanks to the Django docs and `safedelete` for inspiration.

Cheers!

/r/django
https://redd.it/1mvp8pm
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/1mvvn3p
I made "Wove: Beautiful Python async" to help easily make async API and QuerySet calls in views

Hi r/Django, I've released a new library I made for improving the usability of asyncio. I'm a Django developer first, so I designed it with Django views specifically in mind. Check it out and tell me what you think!

[https://github.com/curvedinf/wove/](https://github.com/curvedinf/wove/)

Here is the beginning of the readme to save you a click:

# Wove

Beautiful Python async.

# What is Wove For?

Wove is for running high latency async tasks like web requests and database queries concurrently in the same way as asyncio, but with a drastically improved user experience. Improvements compared to asyncio include:

* Looks Like Normal Python: Parallelism and execution order are implicit. You write simple, decorated functions. No manual task objects, no callbacks.
* Reads Top-to-Bottom: The code in a weave block is declared in the order it is executed inline in your code instead of in disjointed functions.
* Automatic Parallelism: Wove builds a dependency graph from your function signatures and runs independent tasks concurrently as soon as possible.
* High Visibility: Wove includes debugging tools that allow you to identify where exceptions and deadlocks occur across parallel tasks, and inspect inputs and outputs at each stage of execution.
* Normal Python Data: Wove's task data looks like normal Python variables because it is. This is

/r/django
https://redd.it/1mvo3h4
The last supported Python version for Pytype will be 3.12

An update on pytype

“TL;DR: The last supported Python version for Pytype will be 3.12. We are still very actively interested in the space of Python type checking, but shifting our investments towards new ideas and different frameworks.”

/r/Python
https://redd.it/1mvxmi5
Vibe Coding Experiment Failures (with Python code)

A set of apps that ChatGPT 5, Gemini 2.5 Pro, and Claude Sonnet 4 were asked to write Python code for, and how they fail.

While LLMs can create common programs like stopwatch apps, Tetris, or to-do lists, they fail at slightly unusual apps even if they are also small in scope. The app failures included:

African Countries Geography Quiz
Pinball Game
Circular Maze Generator
Interactive Chinese Abacus
Combination Lock Simulator
Family Tree Diagram Editor
Lava Lamp Simulator
Snow Globe Simulator

Screenshots and source code are listed in the blog post:

https://inventwithpython.com/blog/vibe-coding-failures.html

I'm open to hearing about other failures people have had, or if anyone is able to create working versions of the apps I listed.

/r/Python
https://redd.it/1mvmiia
Python freelancing For College

I’m not sure where to put this so I’m guessing the career advice channel. I am currently in pursuit of my bachelors in software engineering with 2 years of Java and Python programming experience. I’m looking for real world experience through freelancing and having a hard time finding clients and winning jobs on upwork,‘I’m not sure if I’m unable to market myself or hat, so I’m looking for advice on how to progress. Please feel free to to @ me or DM me.

/r/Python
https://redd.it/1mw65r2
DSA IN PYTHON OR NOT??

SO I just started doing python 1.5 months ago and now I have good conceptual understanding of python in the sense that i feel a little bit confidence in writing the codes. Everyone around me is saying to start with DSA at this point but there is no online course(free and not paid) for DSA in python and every resource in DSA is either in C++ or java. What should I now. Can anyone pls guide me how I should proceed further from this point

/r/Python
https://redd.it/1mw7vux
Monkesearch: open source, offline natural language query for local files, with temporal awareness

Today I am very excited to release a very bare bones and working prototype for this!
https://github.com/monkesearch/monkeSearch

I'd love to get reviews and suggestions for this, and I've used macOS's inbuilt spotlight indexing for the query. There are a lot of modifications and feature additions to be done now but I want you guys to try it out locally. Current file search is only limited to a few file types because I am associating the macOS specific uniform type identifiers with file types, and that has been done manually just for the prototype right now. Also this is just the prototype / proof of concept and we need more refinement!

What My Project Does:

You can search for your local files using natural english language.

No data leaves your pc and it is aimed at being able to run on potato pcs. And I'm currently aiming at a smaller and smarter model (Gemma 3 270M finetune) to increase the accuracy of the tool (even though it's pretty accurate right away with base Qwen3)

Target Audience:

Whoever wants an easy way to search for file fastly and use natural language/ semantics, this can be the best and most secure tool you can run locally.



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