Python Daily – Telegram
Python Daily
2.56K subscribers
1.49K photos
53 videos
2 files
39K 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 How does Claude perform so well without any proprietary data?

Google has massive proprietary assets (Search, Gmail, Docs, YouTube).

Microsoft/OpenAI has GitHub, Bing, Office, and enterprise data.

xAI has direct access to Twitter/X's social data.

Meta has facebook data.

Anthropic (Claude) however, doesn't appear to own or control any comparably large proprietary data sources. Yet Claude often scores extremely well on reasoning and tasks, many times outperforming other company models.

How Anthropic (Claude) is able to beat their competitiors in model quality?


/r/MachineLearning
https://redd.it/1plg1gs
Seriously underrated Django feature: fixtures

No, not test fixtures, but database fixtures.

I've know about django fixtures for years but I've only recently started using them, and they're utterly brilliant.

The single biggest benefit is:

Found 590 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).

Running tests...
----------------------------------------------------------------------
..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
----------------------------------------------------------------------
Ran 590 tests in 1.560s

...that's 590 tests that complete in 1.56 seconds, using Django's test framework. Most of these tests are at the API level (I prefer nearly all testing to be against the API) with almost no mocking/patching; these are "integration" tests that go through the whole stack, middleware included. Database is sqlite.

The reason for this is: it's exceptionally fast to populate the sqlite database with fixtures. It bypasses much of the ORM, resulting in much quicker database configuration. Also, you can create suites of fixtures that truly do model real-world information, and it makes testing a breeze. In particular, it makes test setup simple, because you simply affix the fixtures to the TestCase and you're off.

One (strong) recommendation: use natural

/r/django
[https://redd.it/1plqyjr
Mcpwn: Security scanner for MCP servers (pure Python, zero dependencies)

#
Mcpwn: Security scanner for Model Context Protocol servers


##
What My Project Does


Mcpwn is an automated security scanner for MCP (Model Context Protocol) servers that detects RCE, path traversal, and prompt injection vulnerabilities. It uses semantic detection - analyzing response content for patterns like `uid=1000` or `root:x:0:0` instead of just looking for crashes.


**Key features:**
- Detects command injection, path traversal, prompt injection, protocol bugs
- Zero dependencies (pure Python stdlib)
- 5-second quick scans
- Outputs JSON/SARIF for CI/CD integration
- 45 passing tests


**Example:**
```bash
python mcpwn.py --quick npx -y u/modelcontextprotocol/server-filesystem /tmp


[WARNING] execute_command: RCE via command
[WARNING] Detection: uid=1000(user) gid=1000(user)


/r/Python
https://redd.it/1plruqa
BehaveDock - A system orchestrator build for E2E testing, suited for the Behave library

I just released my new library: BehaveDock. It's a library that simplifies end-to-end testing for containerized applications. Instead of maintaing Docker Compose files, setting ports manually, and managing relevant overhead to start, seed, and teardown the containers, you define your system's components individually along with their interfaces (database, message broker, your microservices) and implement how to provision them.

The library handles:

* **Component orchestration:** Declare your components and their dependencies as type hints, get them and their details wired automatically (port number, username & password, etc.)
* **Lifecycle management:** Setup and teardown handled for you in the correct order
* **Environment swapping:** You can write implementations for any environment (Local docker, staging, bare-metal execution) and your tests don't need to change; they'll use the same interface.

Built for [Behave](https://behave.readthedocs.io/); Uses [testcontainers-python](https://testcontainers-python.readthedocs.io/). Comes with built-in providers for Kafka, PostgreSQL, Redis, RabbitMQ, and Schema Registry.

# Target Audience

This is aimed at **teams building microservices or monoliths who need reliable E2E tests**.

Ideal if you:

* Have services that depend on databases, message queues, or other infrastructure
* Want to run the same test suite against local Docker containers AND staging
* Are tired of maintaining a separate Docker Compose file just for tests
* Already use or want to use Behave for BDD-style testing

# Comparison

**vs. Docker Compose + pytest:** No external files to maintain. No manual provisioning. Dependencies are resolved in code with proper ordering. Swap from Docker to staging by changing one class; Your behavioral tests are

/r/Python
https://redd.it/1plqmm8
How to implement phone number + OTP login with django-allauth?

I’m currently working on a Django project, and I have a requirement to allow users to log in using their Phone Number and an OTP (One-Time Password) via SMS, besides the standard Email/Username + Password combo.


I'd really like to use django-allauth for auth features.


I know that recent versions of django-allauth added ACCOUNT_PHONE_VERIFICATION_ENABLED and support for phone numbers as a primary identifier, but I don't know how to implement phone number + OTP login.


If anyone has implemented a Phone+OTP flow specifically with django-allauth recently, I’d love to hear how you approached it.


Thanks in advance!

/r/django
https://redd.it/1pluqs8
trying to learn django for a personal project

hi hopefully this is the right flair so I'm trying to make a api in django in vs code and whenever I put in

"python manage.py startapp api"


it gives me the error of my manage.py says there is no such file or directory even though it exists


"'C:\\\\Users\\\\user\\\\OneDrive\\\\Desktop\\\\API coding learn\\\\manage.py': [Errno 2\] No such file or directory"


ive tried to select a interpreter but for some reason when I try and put it in the correct spot vscode doesnt see my manage.py file even though it exist when I look for it in file explorer outside of vs code I've been trying to figure this out for the past 2 days and I'm not sure what else to do does anyone know a fix for this?




/r/djangolearning
https://redd.it/1plqct8
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 noscript 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/1plzvku
How to create a model to match a nested structure.

Hi I am new to Django and Im having trouble figuring out how to model the following structures.

I want to store the presets of an instruments, each preset contains many fields, and nested fields (structs), like the following scheme.

--------------
Preset
Name (string)
BPM (int)
Pan (int)
EffectsOrder (list of IDs)
... More fields

FxLoopSettings
SendValue (int)
Return value (int)
Mode (series or parallel)

CtrlSettings1
CtrlID (int)
EffectID (int)
ParamID (int)
ParamValue (int)

... More CtrlSettings

--------------


As can be seen a preset depends on many CtrlSettings, but I don't know how to describe this relationship as it do not make sense to create a table of CtrlSettings, since each CtrlSettings

/r/django
https://redd.it/1pm48ow
CSS error in Flask

Hi everyone. I need help. I've finished the HTML and CSS for my website and started setting up the database. After downloading the necessary libraries, I started Flask in Python, but Flask can't find my CSS file, nor the PNG file inside it. I've checked the CSS file names countless times, I don't even know how many. I've spent three hours researching and looking at forums, but I'm still confused. I'll leave a few screenshots below, I hope you can help. Take care, guys.



https://preview.redd.it/izldqcwgv27g1.png?width=1918&format=png&auto=webp&s=42fc607b70abe7c8b898a6168f8557135f2b4f7a

https://preview.redd.it/gy41rcwgv27g1.png?width=427&format=png&auto=webp&s=d85b8b20364a3e10d5921ed7b14f86a8ba7286aa

https://preview.redd.it/z64rpdwgv27g1.png?width=1147&format=png&auto=webp&s=8178367d8559d0c39bddb3049416f58623de6c29




/r/flask
https://redd.it/1pm2hty
Implemented 17 Agentic Architectures in a Simpler way

# What My Project Does

I built a hands-on learning project in a **Jupyter Notebook** that implements **multiple agentic architectures** for LLM-based systems.

# Target audience

This project is designed for students and researchers who want to gain a clear understanding of Agent patterns or techniques in a simplified manner.

# Comparison

Unlike high-level demos, this repository focuses on:

* Clear separation of reasoning, tools, and control flow
* Real-world frameworks like **LangChain, LangGraph, and LangSmith**
* Minimal abstraction where possible to keep learning easy

# GitHub

Code, documentation, and example can all be found on GitHub:

[https://github.com/FareedKhan-dev/all-agentic-architectures](https://github.com/FareedKhan-dev/all-agentic-architectures)

/r/Python
https://redd.it/1pm4qsu
Career Question

I have worked as a backend developer for 1 year and used primarily django. For the 6 months I have been working in IT, but I would like to go back to being a software developer again eventually. Im wondering how the job market is looking for you guys, has your django experience helped you land any software jobs?

/r/django
https://redd.it/1pm8eey
The Geminids Meteors & The active Asteroids Phaethon - space science coding

Hey everyone,


have you seen the Geminids last night? Well, in fact they are still there, but the peak was at around 9 am European Time.


Because I just "rejoined" the academic workforce after working in industry for 6 years, I was thinking it is a good time to post something I am currently working on: a space mission instrument that will go to the active asteroid (3200) Phaethon! Ok, I am not posting (for now) my actual work, but I wanted to share with you the astro-dynamical ideas that are behind the scientific conclusion that the Geminids are related to this asteroid.


The parameter that allows us to compute dynamical relation is the so called "D_SH" parameter from 1963! And in a short tutorial I explain this parameter and its usage in a Python noscript. Maybe someone of you wants to learn something about our cosmic vicinity using Python :)?


https://youtu.be/txjo\_bNAOrc?si=HLeZ3c3D2-QI7ESf


And the correspoding code: https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/CompressedCosmos/CompressedCosmos\_Geminids\_and\_Phaethon.ipynb


Cheers,

Thomas

/r/Python
https://redd.it/1pmdshy
How to make flask into an API

I wanna use a frontend framework how do people do this tell me smart people of flask

/r/flask
https://redd.it/1pmfwrb
Scalability - Django Posgres SaaS app

Hello all, we have a saas application that we built on a single database + api + frontend (web and mobile)

as my users grow i will be needing to collect the gps and communicate with them constantly during the day - think of it as thumbtack/service channel tasks etc

in your opinion if i need to sell this to multiple customer and each customer has 100 service reps using this, do you think django and single database with multiple polling would handle 20k concurrent users? whats the impact on the users using web app at the same time etc? database locks? performance issues?

thank you in advance!

/r/django
https://redd.it/1pmjbqi
Maintaining a separate async API

I recently published a Python package that provides its functionality through both a sync and an async API. Other than the sync/async difference, the two APIs are completely identical. Due to this, there was a lot of copying and pasting around. There was tons of duplicated code, with very few minor, mostly syntactic, differences, for example:

1. Using async and await keywords.
2. Using asyncio.Queue instead of queue.Queue.
3. Using tasks instead of threads.

So when there was a change in the API's core logic, the exact same change had to be transferred and applied to the async API.

This was getting a bit tedious, so I decided to write a Python noscript that could completely generate the async API from the core sync API by using certain markers in the form of Python comments. I briefly explain how it works here.

What do you think of this approach? I personally found it extremely helpful, but I haven't really seen it be done before so I'd like to hear your thoughts. Do you know any other projects that do something similar?

EDIT: By using the term "API" I'm simply referring to the public interface of my package, not a typical HTTP API.

/r/Python
https://redd.it/1pme2nx
Ilya Sutskever is puzzled by the gap between AI benchmarks and the economic impact D

In a recent interview, Ilya Sutskever said:

> This is one of the very confusing things about the models right now. How to reconcile the fact that they are doing so well on evals... And you look at the evals and you go "Those are pretty hard evals"... They are doing so well! But the economic impact seems to be dramatically behind.

I'm sure Ilya is familiar with the idea of "leakage", and he's still puzzled. So how do you explain it?

Edit: GPT-5.2 Thinking scored 70% on GDPval, meaning it outperformed industry professionals on economically valuable, well-specified knowledge work spanning 44 occupations.

/r/MachineLearning
https://redd.it/1pm2zsb
How do I add an extra plugin to flask-ckeditor?


I found the link https://github.com/helloflask/flask-ckeditor/issues/11 on how to set up mathjax/extra plugin in flask-ckeditor.

I managed to add the mathjax button but the problem is the button isn’t working.

Here is the button but when I click okay https://imgur.com/a/p6BERkd I get 0 output and when I try something like ​```$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $``` and click submit I get the output of the query from the Posts table and content column in other_page.html ```is <p>$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $</p> ```





Here is the code.
https://pastebin.com/7D4NXEtH


Here is the link of the instructions on how to add an extra button/plugin.
https://github.com/helloflask/flask-ckeditor/issues/11


Here is an image of my route
https://imgur.com/a/UmLnQpS

Here is some of the plugins notice mathjax
https://imgur.com/a/WuivWet


Here are parts of the error in the browser
https://pastebin.com/YwW47SeA


Also in the ide I get the output errors below
https://pastebin.com/4uQFiQVU


I found this error https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#mathjax-no-config .
The problem is the error above I assume. I click on the first link and get to https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-mathJaxLib
and I see this code ```config.mathJaxLib = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML';```.


I am trying to add ``` <noscript> config.mathJaxLib = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML'; </noscript> ``` to the head or body tag and

/r/flask
https://redd.it/1pmlav2
Introducing dj-cache-panel, a universal cache inspector for Django.

Hey everyone, I just released **dj-cache-panel**, a lightweight Django admin extension that lets you query and perform actions on your django cache instances.

Django ships with great caching primitives, but debugging cache issues is still basically guesswork. This project gives you a clean admin UI to browse, inspect, and delete keys across different backend types:

* Works with redis, memcached, local memory, database cache backend
* Search keys (prefix, wildcard, exact match) on backends that support it
* Delete keys in one click
* Zero models, zero migrations
* Works completely using your already defined CACHES setting

Repo: [https://github.com/yassi/dj-cache-panel](https://github.com/yassi/dj-cache-panel)

Docs: [https://yassi.github.io/dj-cache-panel/]()

pypi: [https://pypi.org/project/dj-cache-panel/](https://pypi.org/project/dj-cache-panel/)


This work is a natural extension to my previous work dj-redis-panel, so go ahead and check that out as well.



/r/django
https://redd.it/1pmnkrx
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 denoscription 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

**Denoscription**: 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

**Denoscription**: 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

**Denoscription**: Create a noscript 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/1pmt0u0
Django Roadmap at roadmap.sh

Hi there! My name is Javier Canales, and I work as a content editor at roadmap.sh. For those who don't know, roadmap.sh is a community-driven website offering visual roadmaps, study plans, and guides to help developers navigate their career paths in technology.

We're planning to launch a brand new Django Roadmap. It aims to be comprehensive, targeting Django newbies and mature developers who may want a Django refresh or to improve their fluency. Our primary source is the Django Documentation. However, we're not covering all the topics out there, as we don't want to overwhelm users with an extremely large roadmap.

Before launching the roadmap, we would like to ask the community for some help. Here's the link to the draft roadmap. We welcome your feedback, suggestions, and constructive input. If you have any suggestions for items to include or remove from the roadmap, please let me know.

Once we launch the official roadmap, we will start populating it with content and resources. Contributions will also be welcome on that side via GitHub :)

Hope this incoming roadmap will also be useful for you. Thanks very much in advance.

https://preview.redd.it/3afo8tdlnr6g1.png?width=734&format=png&auto=webp&s=503dc4221f87a42280f6256a13fa787836b69dba



/r/djangolearning
https://redd.it/1pkrfn5