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
D ML conferences need to learn from AISTATS (Rant/Discussion)

Quick rant. As many have noticed and experienced, the quality of reviews at large conferences such as ICLR, ICML. AAAI, NIPS, has generally been very inconsistent with several people getting low quality or even AI written reviews. While this is not too shocking given the number of submissions and lack of reviewers changes need to be made.

Based on my experience and a general consensus by other researchers, AISTATS is the ML conference with the highest quality of reviews. Their approach to reviewing makes a lot more sense and is more similar to other scientific fields and i believe the other ML conferences should learn from them.

For example:
1) they dont allow for any LLMs when writing reviews and they flag any reviews that have even a small chance of being AI written (i think everyone should do this)
2) they follow a structured reviewing format making it much easier to compare the different reviewers points.
3) Reviews are typically shorter and focus on key concerns making it easier to pin point what you should adress.

While AISTATS also isn't perfect in my experience it feels less "random" than other venues and usually I'm sure the reviewers have actually read my work. Their misunderstandingd

/r/MachineLearning
https://redd.it/1p4tme7
Best platform for deploying Django apps in 2025

Haven't deployed a Django app in a long time. I think my last one was deployed using Heroku back when it was very easy to use. I think that is not the case anymore.

What are the best options for 2025/2026?

/r/django
https://redd.it/1p5357w
D How do you create clean graphics that you'd find in conference papers, journals and textbooks (like model architecture, flowcharts, plots, tables etc.)?

just curious. I've been using draw.io for model architecture, seaborn for plots and basic latex for tables but they feel rough around the edges when I see papers at conferences and journals like ICLR, CVPR, IJCV, TPAMI etc, and computer vision textbooks.

FYI I'm starting my graduate studies, so would like to know how I can up my graphics and visuals game!

/r/MachineLearning
https://redd.it/1p4t8l8
Monday Daily Thread: Project ideas!

# Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

## How it Works:

1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.

## Guidelines:

* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.

# Example Submissions:

## Project Idea: Chatbot

**Difficulty**: Intermediate

**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar

**Description**: Create a chatbot that can answer FAQs for a website.

**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)

# Project Idea: Weather Dashboard

**Difficulty**: Beginner

**Tech Stack**: HTML, CSS, JavaScript, API

**Description**: Build a dashboard that displays real-time weather information using a weather API.

**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)

## Project Idea: File Organizer

**Difficulty**: Beginner

**Tech Stack**: Python, File I/O

**Description**: Create a script that organizes files in a directory into sub-folders based on file type.

**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)

Let's help each other grow. Happy

/r/Python
https://redd.it/1p5239o
Adding Vite to Django for a Modern Front End with React and Tailwind CSS (Part of "Modern JavaScript for Django Developers")

Hey folks! Author of the "Modern JavaScript for Django Developers" series here. I'm back with a fresh new guide.

When I first wrote about using modern JavaScript with Django back in 2020, the state-of-the-art in terms of tooling was Webpack and Babel. But—as we know well—the JavaScript world doesn't stay still for long.

About a year ago, I started using Vite as a replacement for Webpack on all my projects, and I'm super happy with the change. It's faster, easier to set up, and lets you do some very nice things like auto-refresh your app when JS/CSS changes.

I've finally taken the time to revisit my "Modern JavaScript for Django Developers" series and update it with what I feel is the best front end setup for Django projects in 2025. There are three parts to this update:

* A brand new guide: [Adding Vite to Django, so you can use Modern JavaScript, React, and Tailwind CSS](https://www.saaspegasus.com/guides/modern-javascript-for-django-developers/integrating-javascript-pipeline-vite/)
* A video walkthrough: [Setting up a Django project with Vite, React, and Tailwind CSS](https://youtu.be/GztJ1h6ZXA0)
* An open-source repository with the finished product you can use to start a new project: [https://github.com/saaspegasus/django-vite-tailwind-starter/](https://github.com/saaspegasus/django-vite-tailwind-starter/)

Hope this is useful, and let me know if you have any questions or feedback!

/r/django
https://redd.it/1p5g975
GeoPolars is unblocked and moving forward

TL;DR: GeoPolars is a similar extension of Polars as GeoPandas is from Pandas. It was blocked by upstream issues on Polars side, but those have now been resolved. Development is restarting!

GeoPolars is a high-performance library designed to extend the Polars DataFrame library for use with geospatial data. Written in Rust with Python bindings, it utilizes the GeoArrow specification for its internal memory model to enable efficient, multithreaded spatial processing. By leveraging the speed of Polars and the zero-copy capabilities of Arrow, GeoPolars aims to provide a significantly faster alternative to existing tools like GeoPandas, though it is currently considered a prototype.

Development on the project is officially resuming after a period of inactivity caused by upstream technical blockers. The project was previously stalled waiting for Polars to support "Extension Types," a feature necessary to persist geometry type information and Coordinate Reference System (CRS) metadata within the DataFrames. With the Polars team now actively implementing support for these extension types, the primary hurdle has been removed, allowing the maintainers to revitalize the project and move toward a functional implementation.

The immediate roadmap focuses on establishing a stable core architecture before expanding functionality. Short-term goals include implementing Arrow data conversion between the underlying Rust

/r/Python
https://redd.it/1p5dtvn
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/1p5xih6
P Feedback/Usage of SAM (Segment Anything)

Hi folks!

I'm one of the maintainers of Pixeltable and we are looking to provide a built-in support for SAM (Segment Anything) and I'd love to chat with people who are using it on a daily/weekly basis and what their workflows look like.

Pixeltable is quite unique in the way that we can provide an API/Dataframe/Engine to manipulate video/frames/arrays/json as first-class data types to work with among other things which makes it very unique programmatically to work with SAM outputs/masks.

Feel free to reply here/DM me or others :)

Thanks and really appreciated!

/r/MachineLearning
https://redd.it/1p5xmhw
CORS Error in my Flask | React web app



Hey, everyone, how's it going?



I'm getting a CORS error in a web application I'm developing for my portfolio.

I'm trying to use CORS in my <app.py> and in my endpoint, but the error persists.
I think it is a simple error, but I am trying several ways to solve it, without success!



Right now, I have this line in my <app.py>, above my blueprint.



# imports
from flaskcors import CORS

def create
app():

app = Flask(name)

...

CORS(app)

...

if name == 'main:

...


PS: I read something about the possibility of it being a Swagger-related error, but I don't know if that makes sense. 











/r/flask
https://redd.it/1p5j53r
MovieLite: A MoviePy alternative for video editing that is up to 4x faster

Hi r/Python,

I love the simplicity of MoviePy, but it often becomes very slow when doing complex things like resizing or mixing multiple videos. So, I built MovieLite.

This started as a module inside a personal project where I had to migrate away from MoviePy due to performance bottlenecks. I decided to extract the code into its own library to help others with similar issues. It is currently in early alpha, but stable enough for my internal use cases.

Repo: https://github.com/francozanardi/movielite

### What My Project Does

MovieLite is a library for programmatic video editing (cutting, concatenating, text overlays, effects). It delegates I/O to FFmpeg but handles pixel processing in Python.

It is designed to be CPU Optimized using Numba to speed up pixel-heavy operations. Note that it is not GPU optimized and currently only supports exporting to MP4 (h264).

### Target Audience

This is for Python Developers doing backend video automation who find MoviePy too slow for production. It is not a full-featured video editor replacement yet, but a faster tool for the most common automation tasks.

### Comparison & Benchmarks

The main difference is performance. Here are real benchmarks comparing MovieLite vs. MoviePy (v2.x) on a 1280x720 video at 30fps.

These tests were run using 1 single process, and the

/r/Python
https://redd.it/1p5vkia
How to do resource provisioning

I have developed a study platform in django

for the first time i'm hosting it

i'm aware of how much storage i will need

but, don't know how many CPU cores, RAM and bandwidth needed?

/r/django
https://redd.it/1p673l9
API tracing with Django and Nginx

Hi everyone,

I’m trying to measure the exact time spent in each stage of my API request flow — starting from the browser, through Nginx, into Django, then the database, and back out through Django and Nginx to the client.

Essentially, I want to capture timestamps and time intervals for:

* When the browser sends the request
* When Nginx receives it
* When Django starts processing it
* Time spent in the database
* Django response time
* Nginx response time
* When the browser receives the response

Is there any Django package or best practice that can help log these timing metrics end-to-end? Currently I have to manually add timestamps in nginx conf file, django middleware, before and after the fetch call in the frontend.

Thanks!

/r/django
https://redd.it/1p64pzt
modeltranslation

As the title states;

how do you guys handle `modeltranslation` as of 2025.

/r/django
https://redd.it/1p6d4wq
Django project flow for understanding

I am developing a project and parallelly learning django rest framework.

Currently, I have comfortably created models, and a customuser (with AbstractBaseUser) and corresponding customusermanager which will communicate with jwt auth. I have also implemented djangorestframework-simplejwt for obtaining token pair. Now, at this point I am at a standstill as to how should I proceed. I also have some confusions regarding customuser and customusermanager, and while studying stumbled upon some extra info such as there are forms and admin to be customized as well for customuser.
Also wondering as, how will I verify the user with jwt token obtained for some other functionalities.

Need help for understanding the general flow for drf+jwt and detailed answers for my abovementioned confusions are appreciated.

Thanks in advance.

/r/djangolearning
https://redd.it/1p6f4bj
uvlink – A CLI to keep .venv in a centralized cache for uv

# GitHub Repo

* [https://github.com/c0rychu/uvlink](https://github.com/c0rychu/uvlink)

# What My Project Does

This tiny Python CLI tool `uvlink` keeps `.venv` out of cloud-synced project directories by storing the real env in a centralized cache and symlinking it from the project.

Basically, I'm trying to solve this `uv` issue: [https://github.com/astral-sh/uv/issues/1495](https://github.com/astral-sh/uv/issues/1495)

# Target Audience (e.g., Is it meant for production, just a toy project, etc.)

It is perfect for `uv` users who sync code to Dropbox, Google Drive, or iCloud. Only your source code syncs, not gigabytes of .venv dependencies.

# Comparison (A brief comparison explaining how it differs from existing alternatives.)

* venvlink: It claims that it only supports Windows.
* uv-workon: It basically does the opposite; it creates symlinks at a centralized link back to the project's virtual environment.

Unless `uv` supports this natively in the future; I'm not aware of a good publicly available solution. (except for switching to `poetry`)

Any feedback is welcome :)

/r/Python
https://redd.it/1p662t0
How good can NumPy get?


I was reading this article doing some research on optimizing my code and came something that I found interesting (I am a beginner lol)

For creating a simple binary column (like an IF/ELSE) in a 1 million-row Pandas DataFrame, the common df.apply(lambda...) method was apparently 49.2 times slower than using np.where().

I always treated df.apply() as the standard, efficient way to run element-wise operations.

Is this massive speed difference common knowledge?

Why is the gap so huge? Is it purely due to Python's row-wise iteration vs. NumPy's C-compiled vectorization, or are there other factors at play (like memory management or overhead)?
Have any of you hit this bottleneck?

I'm trying to understand the underlying mechanics better

/r/Python
https://redd.it/1p65vcm
Breaking Django convention? Using a variable key in template to acces a dict value

I have an application that tracks working hours. Users will make entries for a work day. Internally, the entry is made up of UserEntry and UserEntryItem. UserEntry will have the date amongst other things. UserEntryItems are made of a ForeignKey to a WorkType and a field for the acutal hours.

The data from these entries will be displayed in a table. This table is dynamic since different workers have different WorkTypeProfiles, and also the WorkTypeProfile can change where a worker did general services plus driving services but eventually he goes back to just general services.

So tables will have different columns depending on who and when. The way I want to solve this is: build up an index of columns which is just a list of column handles. The table has a header row and a footer row with special content. The body rows are all the same in structure, just with different values.

For top and bottom row, I want to build a dictionary with key = one of the column handles, and value = what goes into the table cell. For the body, I want to build a list of dictionaries with each dictionary representing one row.

In order to build the

/r/django
https://redd.it/1p6knne
DAG-style sync engine in Django

Project backstory: I had an existing WooCommerce website. Then I opened a retail store and added a Clover POS system and needed to sync data between them. There were not any commercial off the shelf syncing options that I could find that would fit my specific use case. So I created a simple python script that connects to both APIs and syncs data between them. Problem solved! But then I wanted to turn my long single script into some kind of auditable task log.

So I created a dag-style sync engine whichs runs in Django. It is a database driven task routing system controlled by a django front end. It consists of an orchestrator which determines the sequence of tasks and a dispatcher for task routing. Each sync job is initiated by essentially writing a row with queued status in the synccomand table with the dag name and initial payload. Django signals are used to fire the orchestrator and dispatcher and the task steps are run in Celery. It also features a built in idempotency guard so each step can be fully replayed/restarted.

I have deployed this

/r/django
https://redd.it/1p6hgid
Spent a bunch of time choosing between Loguru, Structlog and native logging

Python's native logging module is just fine but modern options like Loguru and Structlog are eye-catching. As someone who wants to use the best tooling so that I can make my life easy, I agonized over choosing one.. perhaps a little too much (I'd rather expend calories now rather than being in production hell and trying to wrangle logs).

I've boiled down what I've learnt to the following:

- Read some good advice here on r/Python to switch to a third party library only when you find/need something that the native libraries can't do - this basically holds true.
- Loguru's (most popular 3rd party library) value prop (zero config, dev ex prioritized) in the age of AI coding is much less appealing. AI can handle writing config boiler plate with the native logging module
- What kills loguru is that it isnt opentelemetry compatible. Meaning if you are using it for a production or production intent codebase, loguru really shouldnt be an option.
- Structlog feels like a more powerful and featured option but this brings with it the need to learn, understand a new system. Plus it still needs a custom "processor" to integrate with OTEL.
- Structlog's biggest value prop -

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