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
Django Email Verification

Hey I tried to implement email verification in django using https://pypi.org/project/Django-Verify-Email/ but the package in the specfied steps is showing as it doesn't exists..any other strategy for email verification?

/r/django
https://redd.it/1myrs86
I got tired of Django project setup, so I built a tool to automate it all

/r/django
https://redd.it/1myuri6
I created a 5 hour free tutorial on creating your own git from scratch using Python

Ever wondered what happens when you run git init, git add, or git commit? In this 5 hour tutorial, we’ll build a minimal version of Git from scratch in Python. By the end, you’ll understand the internals - objects, commits, branches and more because you’ll have written them yourself!

Watch the video here - https://www.youtube.com/watch?v=g2cfjDENSyw

/r/Python
https://redd.it/1myvz9i
need help with comparation values for function to validate closing date

hi guys i've been stuck with this, seems easy but idk what happends

i have this in my serializer, this is a debug i made to varify the type of data

\`\`\`

\[23/Aug/2025 19:29:43\] "GET /vacancies/ HTTP/1.1" 200 13361

<class 'datetime.date'>

<class 'datetime.date'>



def validate\_closing\_date(self, value):



today = timezone.now().date()

print(type(value))

print(type(today))



if value and value <= today:

raise serializers.ValidationError(

"Closing date must be in the future."

)



return value


\`\`\`

and this is the field in my Model

closing_date = models.DateTimeField(
null=True,
blank=True,
help_text="When applications close."
)

```

but the server returns me this error:
TypeError: '<=' not supported between instances of 'datetime.datetime' and 'datetime.date'

idk how to convert the value on my funcition in datetime.datatime or datetime.date

/r/django
https://redd.it/1mz4smi
AsyncFlow: Open-source simulator for async backends (built on SimPy)

Hey r/Python 👋

I’d like to share AsyncFlow, an open-source simulator I’m building to model asynchronous, distributed backends in Python.

# 🔹 What My Project Does

AsyncFlow lets you describe a system topology (client → load balancer → servers → edges) and run discrete-event simulationswith event-loop semantics:

Servers emulate FastAPI+Uvicorn behavior (CPU-bound = blocking, I/O = yields).
Edges simulate network latency, drops, and even chaos events like spikes or outages.
Out-of-the-box metrics: latency distributions (p95/p99), throughput, queues, RAM, concurrent connections.
Input is YAML (validated by Pydantic) or Python objects.

Think of it as a digital twin of a service: you can run “what-if” scenarios in seconds before touching real infra.

# 🔹 Target Audience

Learners: people who want to see what happens in async systems (event loop, blocking vs async tasks, effects of failures).
Educators: use it in teaching distributed systems or Python async programming.
Planners: devs who want a quick, pre-deployment view of capacity, latency, or resilience trade-offs.

Repo: 👉 [
https://github.com/AsyncFlow-Sim/AsyncFlow](https://github.com/AsyncFlow-Sim/AsyncFlow)

I’d love feedback on:

Whether the abstractions (actors, edges, events) feel useful.
Which features/metrics would matter most to you.
Any OSS tips on docs and examples.

Thanks, happy to answer questions! 🚀

/r/Python
https://redd.it/1myuda8
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/1mzbnhm
Adding asyncio.sleep(0) made my data pipeline (150 ms) not spike to (5500 ms)

I've been rolling out the oddest fix across my async code today, and its one of those that feels dirty to say the least.

Data pipeline has 2 long running asyncio.gather() tasks:

1 reads 6k rows over websocket every 100ms and stores them to a global dict of dicts
2 ETLs a deepcopy of the dicts and dumps it to a DB.

After \~30sec of running, this job gets insanely slow.

04:42:01 PM Processed 6745 asyncrunbatchinsert in 159.8427 ms
04:42:02 PM Processed 6711 async
runbatchinsert in 162.3137 ms
...
04:42:09 PM Processed 6712 asyncrunbatchinsert in 5489.2745 ms

Up to 5k rows, this job was happily running for months. Once I scaled it up beyond 5k rows, it hit this random slowdown.

Adding an \`asyncio.sleep(0)\` at the end of my function completely got rid of the "slow" runs and its consistently 150-160ms for days.

async def etl
todb(msg):
# grab a deepcopy of the global msg cache
# etl it
# await dump
todb(etlmsg)
await asyncio.sleep(0) # <-- This "fixed it"

I believe

/r/Python
https://redd.it/1mzcxyc
I built a Python Prisoner's Dilemma Simulator

https://github.com/jasonaaberg/Prisoners-Dilemma

What My Project Does: It is a Python Based Prisoner's Dilemma simulator.

Target Audience: This is meant for anyone who has interests in Game Theory and learning about how to collect data and compare outcomes.

Comparison: I am unaware of any other Python based Prisoner's Dilemma simulators but I am sure they exist.

There's a CLI and GUI version in this repo. It can be played as Human vs. Computer or Computer vs. Computer. There are 3 built in computer strategies to choose from and you can define how many rounds it will play. When you run the auto play all option it will take a little while as it runs all of the rounds in the background and then shows the output.

If you get a chance I would love some feedback. I wrote a lot of the code myself and also use Claude to help out with a lot of the stuff that I couldn't figure out how to make it work.

If anyone does look at it thank you in advance!!!!!

/r/Python
https://redd.it/1mzbj8n
Clipipe – Pipe command output between machines, even behind NAT

Hi everyone 👋

I built [**Clipipe**](https://clipipe.io/), a small open-source tool written in Python that lets you **pipe command output from one machine to another**, even if they’re behind NAT or firewalls.

# 🔹 What My Project Does

Clipipe makes it easy to send and receive data between machines using simple, human-readable codes. You can use it in shell pipelines, so anything you’d normally pipe (`stdout` → `stdin`) can now cross machines.

**Example:**

# Send data
echo "Hello World" | clipipe send
# -> returns a short code, e.g. bafilo42

# Retrieve it elsewhere
clipipe receive bafilo42

It works just as well for files and archives:

tar cz project/ | clipipe send
clipipe receive <code> | tar xz

# 🔹 Target Audience

* Developers who want a quick, frictionless way to move data between machines (work home, dev server, VM host).
* People working behind strict NAT/firewalls where `scp`, `ssh`, or direct networking isn’t possible.
* Anyone who likes CLI-first tools that integrate naturally into existing Unix pipelines.

This is a **production-ready tool** (available on PyPI, installable via `pipx` or `uv`), but also

/r/Python
https://redd.it/1mz83yx
Django+React: SameSite

Hi,

I have a question/need advice about CSRF.

I deployed my django on render, and my frontend in vercel.

In development, I could configure the CSRF to make me being able to make a PUT request from Render to Django.

In deployment, my request doesn't attach the cookie, due to SameSite policy being in Lax (I think, since in development i was in localhost). Do I need to put the SameSite to None, or is there another way?

/r/django
https://redd.it/1mz6r62
Kryypto: a fully keyboard supported python text editor.

Kryypto is a Python-based text editor designed to be lightweight and fully operable via the keyboard. It allows deep customization with CSS and a configuration file, includes built-in Git/GitHub integration, and supports syntax highlighting for multiple formats.

# Features:

* Lightweight – minimal overhead
* Full Keyboard Support – no need for the mouse, every feature is accessible via hotkeys
* Custom Styling
* `config\configuration.cfg` for editor settings
* CSS for theme and style customization
* Editing Tools
* Find text in file
* Jump to line
* Adjustable cursor (color & width)
* Configurable animations (types & duration)
* Git & GitHub Integration
* View total commits
* See last commit message & date
* Track file changes directly inside the editor
* Productivity Features
* Autocompleter
* Builtin Terminal
* Docstring panel (hover to see function/class docstring)
* Tab-based file switching
* Custom title bar
* Syntax Highlighting for
* Python
* CSS
* JSON
* Config files
* Markdown

# Target Audience

* Developers who prefer keyboard-driven workflows (no

/r/Python
https://redd.it/1myslq3
Netbook - a jupyter client for the terminal

Hey folks!

I’m excited to share a project I’ve been hacking on: [netbook](https://github.com/lyovushka/netbook), a Jupyter notebook client that works directly in your terminal (yet another one).

**What My Project Does**

netbook brings the classic Jupyter notebook experience right to your terminal, built using the [textual](https://textual.textualize.io/) framework. It doesn't aim to be an IDE, so there are is no file browser nor any menus. Rather it aims to provide a smooth and familiar experience for jupyter notebook users. Check out the demo on the [github](https://github.com/lyovushka/netbook)

**Highlights**

* Emulates Jupyter with cell execution and outputs directly in the terminal
* Image outputs in most major terminals (Kitty, Wezterm, iTerm2, etc.)
* Pretty printing pandas dataframes
* Kernel selector for working with different languages
* Great for server environments or coding without a browser

**Target Audience**

The intersection of people who prefer working in terminals and people who use jupyter notebooks.

**Comparison**

The key difference with related projects is that netbook doesn't aim to be an IDE. It aims to provide a smooth experience in the limited scope as a notebook environment. Some related projects.

* [euporie](https://euporie.readthedocs.io/en/latest/) is the undisputed king of terminal jupyter clients. One key difference is that euporie predates textual and is built on prompt-toolkit instead.
* [jpterm](https://github.com/davidbrochart/jpterm) is built on textual and has been

/r/Python
https://redd.it/1myrhdt
Need help in serving django static and media file through AWS S3 bucket

I upgraded my project to Django 5.2. Now the problem is I followed all the available tutorial both text and videos and configured my Static and Media file to serve through S3 bucket. But the problem is when I am running collectstatic or uploading any file the static and media directory is created in the local file storage where my application code is deployed instead of S3 bucket. All the available tutorials are at least 1 year old and things have been changed in S3 bucket settings so couldn't follow the whole process. So if someone can provide me the right tutorial that still works, will be thankful to him/her.

/r/django
https://redd.it/1mz1qfs
Should I use AI for my templates generation

Hello guys, I am a junior dev just starting out with django/Python (it's been almost a year of learning).

So, when I started out with Django, I was always writing my templates by hand, as I had a little HTML knowledge. But now, after working on some projects that require me to write more templates, I've found myself using AI for just my templates. Is this good practice or do I need to stop?

/r/djangolearning
https://redd.it/1mxjxr8
[R] Advanced Conformal Prediction – A Complete Resource from First Principles to Real-World

Hi everyone,

I’m excited to share that my new book, ***Advanced Conformal Prediction: Reliable Uncertainty Quantification for Real-World Machine Learning***, is now available in early access.

Conformal Prediction (CP) is one of the most powerful yet underused tools in machine learning: it provides **rigorous, model-agnostic uncertainty quantification with finite-sample guarantees**. I’ve spent the last few years researching and applying CP, and this book is my attempt to create a **comprehensive, practical, and accessible guide**—from the fundamentals all the way to advanced methods and deployment.

# What the book covers

* **Foundations** – intuitive introduction to CP, calibration, and statistical guarantees.
* **Core methods** – split/inductive CP for regression and classification, conformalized quantile regression (CQR).
* **Advanced methods** – weighted CP for covariate shift, EnbPI, blockwise CP for time series, conformal prediction with deep learning (including transformers).
* **Practical deployment** – benchmarking, scaling CP to large datasets, industry use cases in finance, healthcare, and more.
* **Code & case studies** – hands-on Jupyter notebooks to bridge theory and application.

# Why I wrote it

When I first started working with CP, I noticed there wasn’t a single resource that takes you **from zero knowledge to advanced practice**. Papers were often too technical, and tutorials too narrow. My goal was to put everything in one place: the theory, the intuition, and

/r/Python
https://redd.it/1mzmaj1
Django tip Custom Fields with SerializerMethodField

/r/django
https://redd.it/1mzmz8f
16 лет учусь самоучка

здрасьте я будущий программист. Выбрал язык питон, что посоветуете где брать информацию?
беру информацию в интернете блогеры 15 часовые 5 часовые видео смотрю. и еще как правильно практиковатся? все говорят что надо практики много а как правильно это делать?

/r/Python
https://redd.it/1mzv2v2
Don't build search in-house - here's my Django + Algolia demo showing why external search services might be better!

I am not a huge proponent of building search in house - I have put together a demo using which you can quickly integrate an external search service (Algolia).

What I have covered in this demo:

Integrating an existing Django application with a scalable search layer
Using Algolia to automatically index models
Configuring a search interface that is instantaneous and typo-tolerant
Using Algolia to do away with the requirement for independently run search infrastructure


Checkout the video here: https://www.youtube.com/watch?v=dWyu9dSvFPM&ab\_channel=KubeNine

You can find the complete code here: https://github.com/kubenine/algolia-showcase

Please share your views and feedback!

/r/django
https://redd.it/1mzo2ee