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
Best practices for using Python & uv inside Docker

Getting uv right inside Docker is a bit tricky and even their official recommendations are not optimal.

It is better to use a two-step build process to eliminate uv from the final image size.

A two-step build process not only saves disk space but also reduces attack surface against security vulerabilities

/r/Python
https://redd.it/1o3p4bf
I made a game that is teaching you Python! :) After more than three years, I finally released it!

It's called The Farmer Was Replaced

Program and optimize a drone to automate a farm and watch it do the work for you. Collect resources to unlock better technology and become the most efficient farmer in the world. Improve your problem solving and coding skills.

Unlike most programming games the game isn't divided into distinct levels that you have to complete but features a continuous progression.

Farming earns you resources which can be spent to unlock new technology.

Programming is done in a simple language similar to Python. The beginning of the game is designed to teach you all the basic programming concepts you will need by introducing them one at a time.

While it introduces everything that is relevant, it won't hold your hand when it comes to solving the various tasks in the game. You will have to figure those out for yourself, and that can be very challenging if you have never programmed before.

If you are an experienced programmer, you should be able to get through the early game very quickly and move on to the more complex tasks of the later game, which should still provide interesting challenges.

Although the programming language isn't exactly Python, it's similar enough that Python IntelliSense works

/r/Python
https://redd.it/1o3voso
Announcing html-to-markdown v2: Rust rewrite, full CommonMark 1.2 compliance, and hOCR support

Hi Pythonistas,

I'm glad to announce the v2 release of html-to-markdown.

This library started life as a fork of markdownify, a Python library for converting HTML to Markdown. I forked it originally because I needed modern type hints, but then found myself rewriting the entire thing. Over time it became essential for kreuzberg, where it serves as a backbone for both html -> markdown and hOCR -> markdown.

I am working on Kreuzberg v4, which migrates much of it to Rust. This necessitated updating this component as well, which led to a full rewrite in Rust, offering improved performance, memory stability, and a more robust feature set.

v2 delivers Rust-backed HTML → Markdown conversion with Python bindings, a CLI and a Rust crate. The rewrite makes this by far the most performance and complete solution for HTML to Markdown conversion in python. Here are some benchmarks:

Apple M4 • Real Wikipedia documents • convert() (Python)

| Document | Size | Latency | Throughput | Docs/sec |
| ------------------- | ----- | ------- | ---------- | -------- |
| Lists (Timeline) | 129KB | 0.62ms | 208 MB/s | 1,613

/r/Python
https://redd.it/1o3sqqz
Django + Tailwind vs. Django + React

I am building and maintaining a few Django apps and I just love how templates + htmx solves pretty much all my problems.

Recently, I've been asked to look into using something like React/Next.JS for our next project, and as a backend engineer who is too lazy to learn Javascript the "wrong way", I'm trying to come up with alternatives.

Things I like about our current setup:

* It works REALLY well
* I can easily cover everything with tests
* There's almost no blackbox behavior
* Django documentation is GREAT

Things I don't like (and think it can be solved with Tailwind and/or React):

* Look and feel (I don't know how to explain but it feels a bit outdated)
* Having to build things like pagination from the ground up with HTMX or regular requests (feels like it would be easier in React)
* RBAC in DRF seems so much cleaner

I've done some research and I already know the technical details about both approaches but it would be nice to hear from people who actually need to spend time everyday with these technologies.

/r/django
https://redd.it/1o3yzn2
I made a Better Notepad alternative using PySide6

# What My Project Does

ZenNotes is a minimalistic Notepad app with a sleek design inspired by the Fluent Design. It offers the familiar look of the Windows Notepad while having much more powerful features like Translate, TTS, etc.

# Target Audience

Anyone who uses Windows Notepad, or noepads in general

# Comparison 

The target competition is Windows Notepad. ZenNotes is like an "extension" of Windows Notepad, with similar looks but much more features, like TTS, Translate, etc.

# GitHub

https://github.com/rohankishore/ZenNotes

/r/Python
https://redd.it/1o3uy4y
Advice for Azure VM/deployment

Hello everyone,

I have never worked with deployment side, except 1 time bought VM for bot deployment on a some server provider, 3 years ago.

Now, I have to deploy my company web app to Azure platform. My manager said that I would check and choose platform and plan for our web app.

My knowledge about deployment is very limited especially about Azure platform (never worked).

Could someone give me some advice what Azure product to choose in order to deploy and run web app?

About web app backend: python (in future Go), Django/Flask, work with API , use DB (SQLite or Postgres), Docker(probably), some extra libraries, and I think done . App will show some information on 1 page for the start.
It will be used company employees (200 people) 24/7. App will scale in the future .

Thank you in advance,
Regards,

/r/django
https://redd.it/1o47mqh
[D] Kubernetes maintainers are burning out — The New Stack warns of a possible security disaster

/r/MachineLearning
https://redd.it/1o42pq4
Sunday Daily Thread: What's everyone working on this week?

# Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

## How it Works:

1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.

## Guidelines:

Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

## Example Shares:

1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

/r/Python
https://redd.it/1o4ap8i
CSRF Token Verification errors after switching to ASGI

I'm suddenly getting CSRF verification errors POSTing data in my hosted Django (v5.2.7) project after switching over to ASGI (using daphne). No changes were made to the templates/views that are affected. I've also inspected the page to confirm that the CSRF token is being passed to the page.

I did see that there was a report for ASGI applications and HTTP/2 that has since been closed and the related PR has been merged. I'm having a hard time seeing when to expect that change to appear in Django (can't find it mentioned in the release notes for the 5.x versions) But I updated to the latest available version for Django (was using 5.2.5 before), and even tried the alpha build just for kicks and the error still occurs. I also tried changing the config for nginx to set 'off' for http2 and 'on' for http3.

When I was looking into this I saw that some django projects will define an array of domains for CSRF_COOKIE_DOMAIN and CSRF_TRUSTED_ORIGINS. I didn't have those before, but added them in with the same domains as for allowed hosts.

Does anyone have any suggestions or ideas on what could be going on here and what I could try

/r/django
https://redd.it/1o4ci3b
Those who have managed to get into IT in the last couple of years, please share your experiences!

I'm finishing my fourth year of university as a software engineer. Looking at companies' requirements, I realize it's easier to get into IT with your product than to go through a three- or even five-stage interview process for a meager salary.

/r/Python
https://redd.it/1o4hjl6
What’s the best hosting option for a Django + TailwindCSS portfolio site — balancing stability & cost?

I built a dynamic portfolio website using Django (MVT) and TailwindCSS, with a SQLite database.
I’m looking for the best hosting option that offers a good balance between stability and price.

The site is small, gets light traffic, but I still want it to feel reliable and professional.


Any recommendations or experiences with hosting small Django apps like this?

/r/django
https://redd.it/1o4lbwh
[For Hire] Limited Offer: We Build Your Custom Website at a Price You Choose. (15 Days Only)

Hi everyone,

Is a high-quality, custom website the next big step for your business, but the budget is a concern? For the next 15 days, we're trying something different.

**We will build you a professional, custom website, and you set the price.**

We are a team of experienced web developers who believe everyone deserves a great online presence. We're running this "Pay What You Can" promotion to build our portfolio with diverse projects and help out fellow entrepreneurs in the process.

**What you get:**

* A fully custom-designed website (no generic templates).
* Mobile-responsive design that looks great on all devices.
* SEO-friendly structure to help you get found on Google.
* Consultation to understand your brand and business goals.
* Fast turnaround and professional communication.

**How it works:**

1. **DM us** with a brief description of your project and what you need.
2. We'll discuss the details and confirm we're a good fit.
3. You propose a price that you feel is fair for the work.
4. If we agree, we get started right away!

This offer is valid until **October 27, 2025**.

Whether you're a startup, a local shop, or a freelancer needing a portfolio, this is a perfect opportunity to get online without the usual high costs.

Let's build something amazing together. Send us

/r/django
https://redd.it/1o4nk56
Cronboard - A terminal-based dashboard for managing cron jobs

## What My Project Does

Cronboard is a terminal-based application built with Python that lets you manage and schedule cron jobs both locally and on remote servers. It provides an interactive way to view, create, edit, and delete cron jobs, all from your terminal, without having to manually edit crontab files.

Python powers the entire project: it runs the CLI interface, parses and validates cron expressions, manages SSH connections via paramiko, and formats job schedules in a human-readable way.

## Target Audience

Cronboard is mainly aimed at developers, sysadmins, and DevOps engineers who work with cron jobs regularly and want a cleaner, more visual way to manage them.
## Comparison

Unlike tools such as crontab -e or GUI-based schedulers, Cronboard focuses on terminal usability and clarity. It gives immediate feedback when creating or editing jobs, translates cron expressions into plain English, and will soon support remote SSH-based management out of the box using ssh keys (for now, it supports remote ssh using hostname, username and password).

## Features
- Check existing cron jobs
- Create cron jobs with validation and human-readable feedback
- Pause and resume cron jobs
- Edit existing cron jobs
- Delete cron jobs
- View formatted last and next run times
- Connect to servers using SSH

The project is still

/r/Python
https://redd.it/1o4jul0
I built dataspot to find fraud patterns automatically Open Source


After years detecting fraud, I noticed every fraud has a data concentration somewhere.

Built a tool to find them:

pip install dataspot

from dataspot import Dataspot

ds = Dataspot()
hotspots = ds.find(your_data)


What My Project Does
Automatically finds data concentrations that indicate fraud, bot networks, or coordinated attacks. No manual thresholds needed.

Target Audience
Fraud analysts, data scientists, security teams working with transactional or behavioral data.

Comparison
Unlike scikit-learn's anomaly detection (needs feature engineering) or PyOD (requires ML expertise), dataspot works directly on raw data structures and finds patterns automatically.

Full story:
https://3l1070r.dev/en/2025/01/24/building-dataspot.html

Used it in production to detect attacks and anomalies.

- GitHub: https://github.com/frauddi/dataspot
- PyPI: https://pypi.org/project/dataspot/
- Docs: https://frauddi.github.io/dataspot/

Questions welcome.


/r/Python
https://redd.it/1o4gvj5
Running Celery at Scale in Production: A Practical Guide

I decided to document and blog my experiences of running Celery in production at scale. All of these are actual things that work and have been battle-tested at production scale. Celery is a very popular framework used by Python developers to run asynchronous tasks. Still, it comes with its own set of challenges, including running at scale and managing cloud infrastructure costs.

This was originally a talk at Pycon India 2024 in Bengaluru, India.

Substack

Slides can be found at GitHub

YouTube link for the talk

/r/django
https://redd.it/1o4nw6y
without formdata=None explicitly written it will create everything as a formdata? is that normal behaviour? when instantiating the form thing?

I was trying to figure out why a python list wouldn't be validated like a normal python list of strings and it turned out I had to write formdata=None like

form = PackingListForm(formdata=None,data=packing_list_form, meta={'csrf': False})

but this below here was silently giving me an empty list?

form = PackingListForm(data=packing_list_form, meta={'csrf': False})

but the documentation says if u dont pass formdata it will use data? but then it acted like it was formdata then? I dont get it. I know I sound confusing as hell but maybe. someone has an answer or idk if someone ever has this problem they now know what kinda weird obscure thing this is. or hell maybe I am just using it for the wrong purposes entirely. just spent 2 hours and a bunch of llms and documentations and stuff. idk. weird. weird.


/r/flask
https://redd.it/1o4tt81
Advice on logging libraries: Logfire, Loguru, or just Python's built-in logging?

Hey everyone,

I’m exploring different logging options for my projects (fastapi backend with langgraph) and I’d love some input.

So far I’ve looked at:

Python’s built-in `logging` module
Loguru
Logfire

I’m mostly interested in:

Clean and beautiful output (readability really matters)
Ease of use / developer experience
Flexibility for future scaling (e.g., larger apps, integrations)

Has anyone here done a serious comparison or has strong opinions on which one strikes the best balance?
Is there some hidden gem I should check out instead?

Thanks in advance!

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