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
About flask

Ok now I'm familiar with laravel and springboot now I wanna start with flask but I have to ask do I use vscode or inteliji also for sql can i use xampp or is it a good practice to use workbench, also Does it have something like spring initializer.io or not

Is there any youtube video that tackles a video tutorial on starting flask.

/r/flask
https://redd.it/1mq2e7s
I built a terminal-based BitTorrent client in Python — Torrcli

**Hey everyone,**
I’ve been working on a side project over the past few months and wanted to share it. It’s called **Torrcli** — a fast, terminal-based BitTorrent client written in Python. My goal was to make something that’s both beautiful to use in the terminal and powerful under the hood.


**What My Project Does**

Torrcli lets you search, download, and manage torrents entirely from your terminal. It includes a built-in search feature for finding torrents without opening a browser, a basic stream mode so you can start watching while downloading, and full config file support so you can customize it to your needs. It also supports fast resume so you can pick up downloads exactly where you left off.


**Target Audience**

Torrcli is aimed at people who:

* Enjoy working in the terminal and want a clean, feature-rich BitTorrent client there.
* Run headless servers, seedboxes, or low-power devices where a GUI torrent client isn’t practical.
* Want a lightweight, configurable alternative to bloated torrent apps.

While it’s functional and usable right now, it’s still being polished — so think of it as **early but solid** rather than fully production-hardened.


**Comparison to Existing Alternatives**

The market is dominated mostly by gui torrent clients

/r/Python
https://redd.it/1mq5r48
Tasklin - A single CLI to experiment with multiple AI models

Yoo!

I made **Tasklin**, a Python CLI that makes it easy to work with AI models. Whether it’s OpenAI, Ollama, or others, Tasklin lets you send prompts, get responses, and use AI from one tool - no need to deal with a bunch of different CLIs.

# What My Project Does:

Tasklin lets you talk to different AI providers with the same commands. You get JSON responses with the output, tokens used, and how long it took. You can run commands one at a time or many at once, which makes it easy to use in scripts or pipelines.

# Target Audience:

This is for developers, AI fans, or anyone who wants a simple tool to try out AI models. It’s great for testing prompts, automating tasks, or putting AI into pipelines and scripts.

# Comparison:

Other CLIs only work with one AI provider. Tasklin works with many using the same commands. It also gives structured outputs, supports async commands, and is easy to plug into scripts and pipelines.

# Quick Examples:

**OpenAI:**

tasklin --type openai --key YOUR_KEY --model gpt-4o-mini --prompt "Write a short story about a robot"


**Ollama (local model):**

tasklin --type ollama --base-url http://localhost:11434 --model codellama --prompt "Explain

/r/Python
https://redd.it/1mq324g
Why rolling back via signals is not a good practice

so i have very complex relations of 5-8 table that are in postgree, and i have made signals for few , but lets go with an example so if lets say we have a transactions and when an instance is created of tpye A transacation_type then i handle credits accordingly , to rollback this transaction i have also added an audit log which keeps the previous state of instance. i can roll back via signals but i have read somewhere that do not use rollback in signals i want to know the context ,like some people say in signals should handle forwards operations that i want to know why

/r/django
https://redd.it/1mqbxwp
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/1mqhp24
Dreaded Django mistake

This happened in staging or UAT. Migrations and database are not in sync because database was hand edited (columns were dropped). Deployments happened since. I know see 0082A, 0083, 0083, 0084, 0084B. Database reflects 0082A and 0084B. How do I get migrations and database in sync? What is the best way out of this mess? Postgres database hosted in cloud. Staging is our Django app deployed on kubernetes.

/r/django
https://redd.it/1mql9p0
Where Do You Normally Deploy Your Django Web Apps?

I'm a newbie to Django development and I would like to know which platform you can seamlessly deploy your Django apps.

/r/django
https://redd.it/1mpv9da
MicroPie version 0.20 released (ultra micro asgi framework)

Hey everyone tonite I released the latest version of [MicroPie](https://patx.github.io/micropie), my ultra micro ASGI framework inspired by CherryPy's method based routing.

This release focused on improving the frameworks ability to handle large file uploads. We introduced the new `_parse_multipart_into_request` for live request population, added bounded asyncio.Queues for file parts to enforce backpressure, and updated `_asgi_app_http` to start parsing in background.

With these improvements we can now handle large file uploads, successfully tested with a 20GB video file.

You can check out and star the project on Github: [patx/micropie](https://github.com/patx/micropie). We are still in active development. MicroPie provides an easy way to learn more about ASGI and modern Python web devlopment. If you have any questions or issues please file a issue report on the Github page.

The file uploads are performant. They benchmark better then FastAPI which uses Startlet to handle multipart uploads. Other frameworks like Quart and Sanic are not able to handle uploads of this size at this time (unless I'm doing something wrong!). Check out the benchmarks for a 14.4 GB .mkv file. The first is MicroPie, the second is FastAPI:
```
$ time curl -X POST -F "file=@video.mkv" http://127.0.0.1:8000/upload
Uploaded video.mkv
real 0m41.273s
user 0m0.675s
sys 0m12.197s
$ time curl -X POST -F "file=@video.mkv" http://127.0.0.1:8000/upload
{"status":"ok","filename":"video.mkv"}
real 1m50.060s
user 0m0.908s
sys 0m15.743s
```

The code used for FastAPI:
```
import os
import aiofiles
from

/r/Python
https://redd.it/1mqnd7u
A Playbook for Writing AI-Ready, Type-Safe Python Tests (using Pytest, Ruff, Mypy)

Hi everyone,

Like many of you, I've been using AI coding assistants and have seen the productivity boost firsthand. But I also got curious about the impact on code quality. The latest data is pretty staggering: one 2025 study found AI-assisted projects have an **8x increase in code duplication** and a **40% drop in refactoring**.

This inspired me to create a practical playbook for writing Python tests that act as a "safety net" against this new wave of technical debt. This isn't just theory; it's an actionable strategy using a modern toolchain.

Here are a couple of the core principles:

# Principle 1: Test the Contract, Not the Implementation

The biggest mistake is writing tests that are tightly coupled to the internal structure of your code. This makes them brittle and resistant to refactoring.

**A brittle test looks like this (it breaks on any refactor):**

# This test breaks if we rename or inline the helper function.
def test_process_data_calls_helper_function(monkeypatch):
mock_helper = MagicMock()
monkeypatch.setattr(module, "helper_func", mock_helper)

process_data({})


/r/Python
https://redd.it/1mqr6u7
React + Django Channels Help (groupadd() and groupsend() not working)

Hi,

I am learning how to write a project using Django REST Framework + Django Channels + React for the first time and noticed that I for some reason methods like .groupadd() and .groupsend() do not seem to be working in my project, preventing me from joining the Django Channels room and sending messages between the room's members, respectively.

I have tried using ChatGPT to help me debug the problem but it keeps sending me around in circles by asking me to change the "type" field from "chat.join" to "chatjoin" (the name of my async def chatjoin() method), putting print statements before and behind groupadd() and groupsend() to see if those statements appear in the terminal and thus if execution has stopped during the execution of groupadd()/groupsend(), as well as wrapping the chatjoin() method's implementation in try-catch statements to see if it is silently failing, verifying if my Redis database is up and running at the right address (it is), and even overriding the init() and dispatch methods of the my Consumer class to verify if the "chatjoin" method is being received by my consumer (it is).

None of these have worked and it seems like my entire Consumer class is working (I

/r/djangolearning
https://redd.it/1mk8i2j
Decouple module not found in Vercel

I am doing my first ever project and I am making a poll for it.
So 2 weeks ago, I started:

1. Made the poll
2. Added css and stuff and ran it in local server
3. Then I wanted to upload it to a free hosting website
4. Spent 10 days, with no progress

Now the problem is that I have an error persisting "ModuleNotFound: Decouple" I have it downloaded and in the requirements.txt file even it runs locally. I have tried uninstalling and installing it.

If anyone would like to connect over discord and help me fix it. Please do. I would dearly appreciate it.
Ty for your time!

/r/django
https://redd.it/1mqsdcl
I measure my worth in how many tests I have

/r/flask
https://redd.it/1mqq8ex
I open sourced my marketplace app that meets clients and professionals

Hi 👋, I was trying to create an Upwork clone last year. I couldn't proceed further due to budget and time constraints. I've released it as open source on GitHub. It's missing some features, but it might still be helpful for those looking to start a similar project.

Code on Github: https://github.com/adnankaya/weforbiz



You can watch the demo video on YouTube.

Watch Demo: https://www.youtube.com/watch?v=24rpnWShZoU



Tech stack: Python, Django, Redis, PostgreSQL, Celery, Docker



My contact information is on the GitHub repo. You can reach me if you have any questions.

Good luck, everyone.

/r/django
https://redd.it/1mr5ybq
A simple home server to wirelessly stream any video file (or remote URL) to devices in my LA

I was tired of dealing with HDMI cables, "format not supported" errors, and cables just to watch videos from my PC on other devices.

So I wrote a lightweight Python server to fix it: FFmpeg-HTTP-Streamer.



GitHub Repo: https://github.com/vincenzoarico/FFmpeg-HTTP-Streamer



What it does:

\- Streams any local video file (.mkv, .mp4, etc.) on-the-fly. You don't need to convert anything.

\- Can also stream a remote URL (you can extract an internet video URL with the 1DM Android/iOS app). Just give it a direct link to a video.



How you actually watch stuff: just take the .m3u link provided by the server and load it into any player app (IINA, VLC, M3U IPTV app for TV).



On your phone: VLC for Android/iOS.

On your Smart TV (even non-Android ones like Samsung/LG): Go to your TV's app store, search for an "IPTV Player" or "M3U IPTV," and just add the link.



It's open-source, super easy to set up, and I'd love to hear what you think. Check it out and give it a star on GitHub if you find it useful.



Ask me anything!

/r/Python
https://redd.it/1mqw7zr
Python library that shrinks text for LLMs by up to 80%

Came across this library called context-compressor , it uses models like BERT, T5, and BART to compress text while keeping the meaning intact. Pretty handy for RAG pipelines or cutting token costs on OpenAI/Claude API calls.

PyPI: https://pypi.org/project/context-compressor/

/r/Python
https://redd.it/1mr35nv
Looking for a gig

hey guys i am a full stack developer (django + react + react native). I have 2 years of experience using this stack. open to freelance. let me know if i can be of help.

/r/django
https://redd.it/1mqz2mu
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/1mretmg
Could Python ever get something like C++’s constexpr?

I really fell in love with constexpr in c++.

I know Python doesn’t have anything like C++’s constexpr today, but I’ve been wondering if it’s even possible (or desirable) for the language to get something similar.

In C++, you can mark a function as constexpr so the compiler evaluates it at compile time:

constexpr int square(int x) {
if (x < 0) throw "negative value not allowed";
return x x;
}

constexpr int result = square(5); // OK
constexpr int bad = square(-2); // compiler/ide error here

The second call never even runs — the compiler flags it right away.

Imagine if Python had something similar:

@constexpr
def square(x: int) -> int:
if x < 0:
raise ValueError("negative value not allowed")
return x
x

result = square(5)

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