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
MyPy vs Pyright

What's the preferred tool in industry?

For the whole workflow: IDE, precommit, CI/CD.

I searched and cannot find what's standard. I'm also working with unannotated libraries.

/r/Python
https://redd.it/1ovivvs
How do I stop and start ./manage.py runserver automatically?

I have a docker container running this command. I need to automatically make it stop and start so that it can pick up new changes in the environment. How can I do it. I would optimally need something the checks a condition after each minute and then restart this command.

/r/djangolearning
https://redd.it/1ou632x
D CVPR submission number almost at 30k

Made my CVPR submission and got assigned almost a 30k submission number. Does this mean there are \~30k submissions to CVPR this year? That is more than double of last years...

/r/MachineLearning
https://redd.it/1ovqvdr
D How to sound more like a Researcher

I have been working in Applied ML for the last 10 years but in the last 2 have had a much stronger research focus and have published a few papers. Through that I have a few people reach out for some frontier labs for some research positions (my 10 years have been in FAANG). This would be a career jump that I would love but I find in my interviews I sound too applied and not researchey enough. This makes me feel very unconfident in discussing what I have done. Applied interviews are more like exams and these are more like defending a thesis.

Any suggestions for improvement? (I do stay up to date with current papers but honestly there are so many that I may not be in full depth about everything)

/r/MachineLearning
https://redd.it/1ovtrn4
Keecas: Dict-based symbolic math for Jupyter with units support and automatic LaTeX rendering

As a structural engineer I always aimed to reduce the friction between doing the calculation and writing the report. I've been taught symbolic math with units, but the field is dominated by Word and Excel, neither of which is a good fit. Thanks to Quarto I've been able to break the shackle of Office and write reproducible documents (BONUS: plain text is a bliss).

# What My Project Does

Keecas is a Python package for symbolic and units-aware calculations in Jupyter notebooks, specifically designed for Quarto-rendered documents (PDF/HTML). It minimizes boilerplate by using Python dicts and dict comprehension as main equations containers: keys represent left-hand side symbols, values represent right-hand side expressions.

The package combines SymPy (symbolic math), Pint (units), and functional programming patterns to provide automatic LaTeX rendering with equation numbering, unit conversion, and cross-referencing.

# Target Audience

Engineers writing calculation reports and technical documentation
Scientists creating reproducible notebooks with units
Academics preparing papers with mathematical content (likely not mathematicians though, those pesky folk have no use for units; or numbers)
Anyone using Jupyter + Quarto for technical documents requiring LaTeX output

>NOTE: while keecas includes features aimed at Quarto, it can be used just as easily with Jupyter notebooks alone.

keecas is available on

/r/Python
https://redd.it/1ow4shz
is there any way to detect and filter out bot traffic?

hi, I am a django lover, nowadays I feel there are a lot of bot traffics in my website.. any ways to detect and block bots? is there any python package or other? not capcha or cloudflare

/r/django
https://redd.it/1ow7s2k
From 59 lines of tutorial code to 260,000 lines powering a production SaaS

Ever wondered what Flask looks like in production? Here are some insights into a Flask app with over 150 thousand users. Enjoy!

## How it started

In 2016, I started a Flask tutorial because I had an idea for a simple app. I knew a little bit about HTML and CSS but
almost nothing about database driven apps. I continued building on this codebase for nine years. Now,
that same app has hundreds of thousands of registered users, earns thousands
of revenue per month, and has changed my life forever.

Despite its unglamorous beginnings I never rewrote the app from scratch, I just kept on adding to it (and sometimes
taking away). Whenever I faced a
problem or a challenging requirement, I churned, ground and didn't give up until it was fixed. Then I moved on to the
next task.

## Some stats

Some usage stats:

* 400k visitors per month
* 1.5 million page views per month
* 8k signups per month with 180k signed-up users overall
* 80 requests per second

Some code stats:
- Python: **51,537 lines**
- Vue/JavaScript: **193,355 lines**
- HTML: **16,414 lines**
- **Total: ~261,000 lines of code**

## The architecture and customizations

OK, onto the code! Here is a top-level overview:

* The main database is Postgres and I use Peewee as

/r/flask
https://redd.it/1owbrvx
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/1owhaba
R is Top-K edge selection preserving task-relevant info, or am I reasoning in circles?

I have m modalities with embeddings Hi. I learn edge weights Φij(c, et) for all pairs (just a learned feedforward function based on two embeddings + context), then select Top-K edges by weight and discard the rest.

My thought , Since Φ
ij is learned via gradient descent to maximize task performance, high-weight edges should indicate that modalities i and j are relevant together. So by selecting Top-K, I'm keeping the most useful pairs and discarding irrelevant ones.

Problem: This feels circular.. “Φ is good because we trained it to be good."

Is there a formal way to argue that Top-K selection preserves task-relevant information that doesn't just assume this?

/r/MachineLearning
https://redd.it/1ow7g2u
D Question about self-referential novelty gating

I’ve been wondering about continual learning and noticed that most setups treat “novelty” as a single scalar, usually tied to prediction error or surprise. But in humans, a surprise that feels self-relevant (“this is about me / my situation”) clearly lands differently from a random trivia fact. So I’m wondering if it makes sense to give agents a simple “self-score” for each event and let that bias what gets written into long-term memory.

For example like this a promotion gate I imagined for an episodic memory buffer

effective\\_score = score + alpha \\* self\\_score

if effective\\_score >= SCORE\\_THRESH and dist\\_to\\_neighbors <= RADIUS\\_THRESH:

promote\\_to\\_long\\_term(memory)

Intuitively, this would mean self-relevant surprises are slightly more likely to be preserved and influence future behavior, without just globally increasing the learning rate. Has anyone tried something like this in practice (RL agents, LLM agents with memory, etc.) or seen papers where self-relevance is treated as an explicit signal in the learning rule, rather than just a psychological observation?

/r/MachineLearning
https://redd.it/1ow8587
I want to build and use custom MCP in my Django project. Have any suggestion on this?

I'm working on a project where users can explore the entire database and create dashboards using simple natural language queries. I've already implemented the system of connecting different types of databases like PostgreSQL, MongoDB, SQLite, CSV, Excel, etc., and created a chat model and views for that. It's currently having simple OpenAI calls for the query responses.


Now, I want to connect the databases to chat so that when the user writes the query, it talks to connected chat databases and provide responses based on that.


For this, I want to use the MCP in my project, as the MCP perfectly works with AI.

Does anyone have any experience with a similar situation and can guide me in this?

Thanks in advance to everyone!

/r/django
https://redd.it/1ow0kfw
Google Oauth

I have built an refer based web application and created a JWT and role based session login.....That works brilliantly but when I am trying to integrate google Oauth book my server can't return tokens to Google based users why is that ?

How can I resolve?

Any suggestions?


P.s: Also pls dm if ur a flutter based dev looking forward to connect!!

/r/django
https://redd.it/1owrihr
Accounting + Python

Any accounts here use Python to successfully help/automate their jobs? If so how?

My next question is: do you have to install and IDE on your work computer to have it work? If so, what are the use cases I can sell to my boss to let me install?

/r/Python
https://redd.it/1owedv4
Where do you guys actually find Django work?

I've been working in tech for 6 years, mostly writing, but the technical side, like spinning up VMs and load testing hosting providers, benchmarking performance, that sort of thing.

I just finished a backend program and have some decent projects (e-commerce API, Telegram bot with Celery/Redis, the usual portfolio stuff). I know my way around Django/Python/Docker reasonably well at this point.

But I feel like I'm looking in the wrong places. Where do people actually find this work? Is it all networking? Discord servers? Freelance sites? Should I just be cold emailing companies?

What worked for you?

/r/django
https://redd.it/1owsf7c
Flask vs FastAPI for High CPU and High I/O Bounded Usage

Hello,


I have a scenario where I have heavy CPU load due to ML calls, etc and also I have heavy networking and I/O bound. I tried flask but it's very obvious that with lots of requests, the overhead of threads created by gunicord nonetheless the overhead of thread pool executor will add up latency to request.


FastAPI on the other hand is more complex in terms of how it handles requests as I see it I don't have much control over what happens and is difficult to debug.


I am unware of any extension to both...but my system already build using flask and I am worried that I might selected wrong framework.


Your thoughts?

/r/flask
https://redd.it/1owosst
P I visualized 8,000+ LLM papers using t-SNE — the earliest “LLM-like” one dates back to 2011

I’ve been exploring how research on large language models has evolved over time.

To do that, I collected around 8,000 papers from arXiv, Hugging Face, and OpenAlex, generated text embeddings from their abstracts, and projected them using t-SNE to visualize topic clusters and trends.

The visualization (on awesome-llm-papers.github.io/tsne.html) shows each paper as a point, with clusters emerging for instruction-tuning, retrieval-augmented generation, agents, evaluation, and other areas.

One fun detail — the earliest paper that lands near the “LLM” cluster is “Natural Language Processing (almost) From Scratch” (2011), which already experiments with multitask learning and shared representations.

I’d love feedback on what else could be visualized — maybe color by year, model type, or region of authorship?

/r/MachineLearning
https://redd.it/1owz9g5
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/1oxcssf
Best Cheap Hosting for Django/Wagtail CMS Website

Hi everyone,

I’m planning to launch a simple educational website for students in Bangladesh using Django + Wagtail. The site will mainly contain text content and explainer images, so I’m looking for very affordable hosting options that support Django deployments.

I’ve checked PythonAnywhere, Railway, and Render. I also found Contabo VPS, which is extremely cheap, but I’m unsure about their reliability.

Has anyone used Contabo for Django projects? Are they stable in terms of uptime and performance? And are there any other budget-friendly hosting providers you’d recommend?

Thanks in advance for your suggestions!

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