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
What is the point of CSRF for form validation?

Hello,

I am currently in the process of building a small app aiming to localy train small AI models. I keep seeing on the internet that desactivating the CSRF in forms is super dangerous, but is it if the app will be run localy only, and not have "sensitive" (ie account management) informations uploaded?

Right now I have forms to upload a project name and training files, I don't think I need CSRF for these?

Thanks in advance

/r/flask
https://redd.it/1oo94xx
Free Introductory Python Book (amongst others)

I recently discovered the wonderful collection of free textbooks made available by the openstax organisation (https://openstax.org/). There are many books available covering a wide range of disciplines but there’s one in particular that may be of interest to redditors here, namely Introduction to Python Programming: https://openstax.org/details/books/introduction-python-programming

Another notable example is Principles of Data Science: https://openstax.org/details/books/principles-data-science

There are many others including texts on mathematics and computer science.

/r/Python
https://redd.it/1op1ghd
First event Django Day India is here - November 8, 2025

We’re excited to invite you to Django Day India 2025, the biggest Django community event in the country!

The schedule is now live, featuring talks on Django, Python, architecture, scalability, and open source from some of the most active contributors in the ecosystem.

Keynote Speakers:

Thibaud Colas — President, Django Software Foundation & Tech Lead at Torchbox

Sarah Abderemane — Vice President, Django Software Foundation & Software Engineer at Kraken Tech

Whether you’re building with Django daily or just passionate about web development, this is a great chance to learn, connect, and be part of India’s growing Django community

Tickets are closing tomorrow , so grab yours before they sell out!

tickets: https://konfhub.com/djangoday-india-2025

Official website: djangoday.in

Come for the code, stay for the community!

/r/django
https://redd.it/1op14p2
Looking for a Mentor

Hello Everyone,

I started learning Django today, I need a mentor, who can guide me in this Journey.

TIA.

/r/djangolearning
https://redd.it/1ooqqdb
Can anyone suggest me resources to learn django, need to make an ai chat ap with semantic search on chats



/r/djangolearning
https://redd.it/1oms8o8
Flask-Compress 1.22 released

2 releases were made recently to add support for streaming responses.
No more buffering the entire response to compress it, it now happens on the fly

/r/flask
https://redd.it/1op4w9f
Create a Flask app-website

Hi I am learning python and I would like to create a website using Flask like a personal page. How does it work? Do you know useful materials? How do I buy a domain? Should I buy it?

/r/flask
https://redd.it/1ondv3r
Best practice for Django PKs in 2025 - Auto-Incrementing or UUIDField?

I am wondering what the consensus is for a public website and if you should use Django's default auto-incrementing IDs or switch to using UUID4 as the primary key.

I've read arguments of both sides and am still not able to draw a conclusion.

I'm slowly settling on keep the PK as the Django auto-incrementing and adding separate UUID field that is a generated UUID4 value.

Thoughts?

import uuid
from django.db import models
from nanoid import generate

class Product(models.Model):
# Keep the default original Django auto-incrementing PK

# uuid4 for internal use and for distributed databases to work together
uuid = models.UUIDField(
default=uuid.uuid4,
editable=False,
db_index=True,
)

#

/r/django
https://redd.it/1opi4xl
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/1opjo5c
FastAPI’s creator on the framework’s popularity, FastAPI Cloud, self-taught developers, and more

Hi there! I’m a huge fan of FastAPI for its focus on developer experience. This year it became the most popular Python framework, which comes as no surprise.

Recently I had the chance to chat with Sebastián Ramírez, the creator of FastAPI. We talked about why it became so popular since its launch seven years ago, what’s next on the roadmap, FastAPI Cloud, the impact of the faster CPython initiative, and being a self-taught developer (yes, he’s self-taught!). We also talked about that famous tweet about companies asking for more years of experience with a framework than it’s even existed.

Sebastián was super nice, kind and humble. I didn't expect someone so popular to be so down-to-earth.

I think there are some useful takeaways here for other devs in this community, so I'm sharing the link below. I welcome any feedback for how I can make these interviews better.

https://youtu.be/iaDRYUQ0OMM

/r/Python
https://redd.it/1op2dut
Cleanest way to handle a dummy or no-op async call with the return value already known?

Since there doesn't appear to be an async lambda, what's the cleanest way you've found to handle a batch of async calls where the number of calls are variable?

An example use case is that I have a variable passed into a function and if it's true, then I do an additional database look-up.

Real world code:

        emails, confirmed = await asyncio.gather(
            self._get_emails_for_notifications(),
            (
                self._get_notification_email_confirmed()
                if exclude_unconfirmed_email
                else asyncio.sleep(0, True)
            ),
        )
        if not emails or not confirmed:
            raise NoPrimaryNotificationEmailError(self.user_id)
        return emails[0]

Using a sleep feels icky. Is this really the best approach?

/r/Python
https://redd.it/1opdok1
Nuttiest 1 Line of Code You have Seen?

Quality over quantity with chained methods, but yeah I'm interested in the maximum set up for the most concise pull of the trigger that you've encountered

/r/Python
https://redd.it/1ooysmw
htmx is back with version 4.0 - the fetch()ening

So even though Carson said that 2.0 is the final version and there will not be version 3.0, he didn’t lie - it's version 4.0.

https://preview.redd.it/f15rokhuvmzf1.png?width=577&format=png&auto=webp&s=925c3c3689333134a1f2dcb5aaee737f1dc0f7bd

There are some cool backstage enhancements and also some breaking changes if you want to use the new version. But some really fix the annoying quirks.

I know lots of Django folks use the library, so I thought I’ll post it here. I know I use it today almost on all my new projects when fit.

Official announcement here: https://htmx.org/essays/the-fetchening/
I wrote a short migration piece with some extra unneeded info on Medium here: https://medium.com/@alonwo/htmx-4-0-the-fetchening-a-developers-guide-to-what-s-actually-changing-28fb80b36bd9

/r/django
https://redd.it/1opy4yv
Support for Python OCC

I have been trying to get accustomed to Python OCC, but it seems so complicated and feels like I am building my own library on top of that.

I have been trying to figure out and convert my CAD Step files into meaningful information like z
Counterbores, Fillets, etc. Even if I try to do it using the faces, cylinders, edges and other stuff I am not sure what I am doing is right or not.


Anybody over here, have any experience with Python OCC?

/r/Python
https://redd.it/1oq1isg
[R][N] TabPFN-2.5 is now available: Tabular foundation model for datasets up to 50k samples

TabPFN-2.5, a pretrained transformer that delivers SOTA predictions on tabular data without hyperparameter tuning is now available. It builds on TabPFN v2 that was released in the [Nature](https://www.nature.com/articles/s41586-024-08328-6) journal earlier this year.

Key highlights:

* 5x scale increase: Now handles 50,000 samples × 2,000 features (up from 10,000 × 500 in v2)
* SOTA performance: Achieves state-of-the-art results across classification and regression
* Rebuilt API: New REST interface & Python SDK with dedicated fit & predict endpoints, making deployment and integration significantly more developer-friendly

Want to try it out? TabPFN-2.5 is available via an [API](https://docs.priorlabs.ai/api-reference/getting-started) and via a package on [Hugging Face](https://huggingface.co/Prior-Labs).

We welcome your feedback and discussion! You can also join the discord [here](https://discord.com/invite/VJRuU3bSxt).

/r/MachineLearning
https://redd.it/1oq1gq1
edge-tts suddenly stopped working on Ubuntu (NoAudioReceived error), but works fine on Windows

Hey everyone,

I’ve been using the **edge-tts** Python library for text-to-speech for a while, and it has always worked fine. However, it has recently stopped working on **Ubuntu** machines — while it still works perfectly on **Windows,** using the same code, voices, and parameters.

Here’s the traceback I’m getting on Ubuntu:

NoAudioReceived Traceback (most recent call last)
/tmp/ipython-input-1654461638.py in <cell line: 0>()
13
14 if __name__ == "__main__":
---> 15 main()

10 frames
/usr/local/lib/python3.12/dist-packages/edge_tts/communicate.py in __stream(self)
539
540 if not audio_was_received:
--> 541 raise NoAudioReceived(


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