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
The Right Gatekeepers: How to secure your Flask app with Flask-Security

This week I wrote a new tutorial for the publication, "Python in Plain English" on how to secure your Flask Admin dashboard with Flask-Security.

https://preview.redd.it/307axi7brl2g1.png?width=1232&format=png&auto=webp&s=4a993eacfe9f3af1b97b11ac924ae0330148f407

There were quite a few steps involved in making Flask Admin and Flask Security work well together. This included having to downgrade to Flask-Security-Too version 4.1.5. Let me know in the comments what you think. I am also using Flask-Admin 1.6.1

If you are not a Medium member you can click the "friend link" at the top of the tutorial: https://python.plainenglish.io/the-right-gatekeepers-secure-your-python-flask-app-with-flask-security-part-2-2-2cf8a7f1e667

/r/flask
https://redd.it/1p2xadr
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/1p3ek72
eCommerce - Django Oscar vs Mainstream

I've been building online stores with Django Oscar for years.

Because of that, I ended up losing touch with the more popular mainstream solutions like Shopify, WooCommerce, etc.

For those who have used both approaches (custom Django/Oscar stack vs SaaS platforms):

What do you feel are the main downsides of sticking with something like Django Oscar today?And in which cases does a mainstream solution clearly win?

/r/django
https://redd.it/1p2wwq1
The Pocket Computer: How to Run Computational Workloads Without Cooking Your Phone

https://github.com/DaSettingsPNGN/S25_THERMAL-

I don't know about everyone else, but I didn't want to pay for a server, and didn't want to host one on my computer. I have a flagship phone; an S25+ with Snapdragon 8 and 12 GB RAM. It's ridiculous. I wanted to run intense computational coding on my phone, and didn't have a solution to keep my phone from overheating. So. I built one. This is non-rooted using sys-reads and Termux (found on F-Droid for sensor access) and Termux API (found on F-Droid), so you can keep your warranty. 🔥

What my project does: Monitors core temperatures using sys reads and Termux API. It models thermal activity using Newton's Law of Cooling to predict thermal events before they happen and prevent Samsung's aggressive performance throttling at 42° C.

Target audience: Developers who want to run an intensive server on an S25+ without rooting or melting their phone.

Comparison: I haven't seen other predictive thermal modeling used on a phone before. The hardware is concrete and physics can be very good at modeling phone behavior in relation to workload patterns. Samsung itself uses a reactive and throttling system rather than predicting thermal events. Heat is continuous and temperature isn't an isolated

/r/Python
https://redd.it/1p37186
Bobtail - A WSGI Application Framework

I'm just showcasing a project that I have been working on slowly for some time.

https://github.com/joegasewicz/bobtail

# What My Projects Does

It's called Bobtail & it's a WSGI application framework that is inspired by Spring Boot.

It isn't production ready but it is ready to try out & use for hobby projects (I actually now run this in production for a few of my own projects).

# Target Audience

Anyone coming from the Java language or enterprise OOP environments.

# Comparison

Spring Boot obviously but also Tornado, which uses class based routes.



I would be grateful for your feedback, Thanks

#





/r/Python
https://redd.it/1p3c9gi
What is the best Django course today (beginner → advanced)? Books, video, blog… anything.

I’m getting back into learning Django after stopping for a while, and I want to restart with modern learning resources that match the current real-world tech stack (Django 5.x, DRF, async, AI integration, modern tooling, etc.).

I’m looking for recommendations for the best learning path from beginner to advanced, including:

Online courses
YouTube tutorials
Books
Blogs/documentation
Project-based learning resources
Anything that helped you go from “I know nothing” to job-ready

Ideally, I want resources that focus on production-level skills, not just toy apps.

If you’ve learned Django recently (2023–2025), what resources made the biggest difference for you?

Thanks in advance!

/r/django
https://redd.it/1p2tgqx
CAN SOME ONE EXPLAIN THIS?

https://programmers-haven.myshopify.com/
IM CONFUSED ABOUT WHAT THIS GUY IS TRYING TO SELL. IS THIS LEGIT?

/r/Python
https://redd.it/1p3ntd8
Need help to make small changes

Can any good person help me with my class project? I will fail if i don't do it.need to get it done asaf I need to make some changes all instructions and how to do it are written. But still i don't know much code. The stack used is python flask.

About the software

It's a simple website which has login,admin,user, posting feature. The main goal is to make it free from any cyber vulnerability. Now the software has some vulnerability pointed out by another team. They have given us a report on it and what we should do. We need to make some changes implement 2-3 basic authentication features.


Please help 🙏😭

/r/flask
https://redd.it/1p3ga4p
Is there any way to simulate a slow network connection on localhost?

When I build a Flask app and test it on localhost, can I simulate a slow connection? (For example, by a python module that allows me to determine the speed of sending data from the Flask server)

/r/flask
https://redd.it/1p3pypy
Avenv - A Minimal Virtual Environment Script for Python

# What My Project Does

This is a minimal Linux-compatible script that streamlines Python virtual environment management. It creates each environment inside a dedicated directory in your home folder and sources the activate script directly. No wrappers, no frameworks, no extra abstractions.

Workflow example:

$ avenv -m newvenv
$ source avenv new
venv

# Target Audience

Developers who want a lightweight, zero-overhead method for managing Python virtual environments. Intended for personal workflows and simple development setups, not complex production pipelines.

# Comparison

Compared to tools like virtualenvwrapper, pipenv, or poetry, this script adds no metadata, no new workflow concepts, and no dependency management. It is a thin wrapper around python -m venv that provides a predictable, minimal interface focused solely on creating and activating environments.

# Background

I built this script for my own use several years ago, and it remains the most efficient workflow I’ve used for handling Python virtual environments.

Link: https://github.com/begbaj/avenv/

/r/Python
https://redd.it/1p3rxb6
I’m building a Python-native frontend framework that runs in the browser (Evolve)

I’m currently building a personal project called Evolve \- a Python-native frontend framework using WebAssembly and a minimal JavaScript kernel to manage DOM operations.

The idea: write UI logic in Python, run it in the browser, with a reactive system (no virtual DOM).

Still early stage, - I’ll be posting progress, architecture, and demos soon.

Would love to know: would you try a Python-first frontend framework?

/r/Python
https://redd.it/1p3p00u
If one python selling point is data-science and friends, why it discourages map and filter?

… and lambda functions have such a weird syntax and reduce is hidden in functools, etc.? Their usage is quite natural for people working with mathematics.

/r/Python
https://redd.it/1p3mjlc
How do you implement customizable document templates (like QuickBooks)


I’m building an invoicing module in Django, and right now all my document templates (Quotation, POS Receipt, etc.) are hard-coded as Django HTML templates.

I want to redesign this so that:

- Multiple templates exist per document type

(e.g., Standard Invoice, Minimalist, POS Receipt, Japanese Style, etc.)

- Users can choose which template their organisation uses

(at setup time or inside settings)

- Users can customize parts of the template

(override header, colors, messages, table layout, footer text… basically inject custom HTML blocks)

- Ability to preview templates

(ideally show a small thumbnail preview)

/r/django
https://redd.it/1p43aga
Onlymaps, a Python micro-ORM

Hello everyone! For the past two months I've been working on a Python micro-ORM, which I just published and I wanted to share with you: https://github.com/manoss96/onlymaps

Any questions/suggestions are welcome!

## What My Projects Does

A micro-ORM is a term used for libraries that do not provide the full set of features a typical ORM does, such as an OOP-based API, lazy loading, database migrations, etc... Instead, it lets you interact with a database via raw SQL, while it handles mapping the SQL query results to in-memory objects.

Onlymaps does just that by using Pydantic underneath. On top of that, it offers:

- A minimal API for both sync and async query execution.
- Support for all major relational databases.
- Thread-safe connections and connection pools.

## Target Audience

Anyone can use this library, be it for a simple Python script that only needs to fetch some rows from a database, or an ASGI webserver that needs an async connection pool to make multiple requests concurrently.

## Comparison

This project provides a simpler alternative to typical full-feature ORMs which seem to dominate the Python ORM landscape, such as SQLAlchemy and Django ORM.

/r/Python
https://redd.it/1p3us1n
Python - Numerical Evidence - max PSLQ to 4000 Digits for Clay Millennium Problem (Hodge Conjecture)

* **What My Project Does**

The Zero-ology team recently tackled a high-precision computational challenge at the intersection of HPC, algorithmic engineering, and complex algebraic geometry. We developed the **Grand Constant Aggregator (GCA)** framework -- a fully reproducible computational tool designed to generate **numerical evidence** for the **Hodge Conjecture** on **K3 surfaces** ran in a Python script.

The core challenge is establishing formal certificates of numerical linear independence at an unprecedented scale. GCA systematically compares known transcendental periods against a canonically generated set of ρ real numbers, called the **Grand Constants**, for K3 surfaces of Picard rank ρ ∈ {1,10,16,18,20}.

The GCA Framework's core thesis is a computationally driven attempt to provide overwhelming numerical support for the Hodge Conjecture, specifically for five chosen families of K3 surfaces (Picard ranks 1, 10, 16, 18, 20).

The primary mechanism is a test for linear independence using the PSLQ algorithm.

The Target Relation: The standard Hodge Conjecture requires showing that the transcendental period $(\\omega)$ of a cycle is linearly dependent over $\\mathbb{Q}$ (rational numbers) on the periods of the *actual* algebraic cycles ($\\alpha\_j$).

The GCA Substitution: The framework substitutes the unknown periods of the algebraic cycles ($\\alpha\_j$) with a set of synthetically generated, highly-reproducible, transcendental numbers, called the **Grand Constants** ($\\mathcal{C}\_j$), produced by the **Grand Constant Aggregator (GCA)** formula.

The Test: The framework tests for an integer linear dependence

/r/Python
https://redd.it/1p44cr8
Built free interview prep repo for AI agents, tool-calling and best production-grade practices

I spent the last few weeks building the tool-calling guide I couldn’t find anywhere: a full, working, production-oriented resource for tool-calling.

What’s inside:

66 agent interview questions with detailed answers
Security + production patterns (validation, sandboxing, retries, circuit breaker, cost tracking)
Complete MCP spec breakdown (practical, not theoretical)
Fully working MCP server (6 tools, resources, JSON-RPC over STDIO, clean architecture)
MCP vs UTCP with real examples (file server + weather API)
9 runnable Python examples (ReAct, planner-executor, multi-tool, streaming, error handling, metrics)

Everything compiles, everything runs, and it's all MIT licensed.

GitHub: https://github.com/edujuan/tool-calling-interview-prep

Hope you some of you find this as helpful as I have!

/r/Python
https://redd.it/1p469il
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 script 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/1p4851a
Why do devs prefer / use PyInstaller over Nuitka?

I've always wondered why people use PyInstaller over Nuitka?

I mean besides the fact that some old integrations rely on it, or that most tutorials mention PyInstaller; why is it still used?

For MOST use cases in Python; Nuitka would be better since it actually compiles code to raw machine (C) code instead of it being a glorified [.zip\] file and a Python interpreter in it.


Yet almost everyone uses PyInstaller, why?


Is it simplicity, laziness, or people who refuse to switch just because "it works"? Or does PyInstaller (same applies to cx_Freeze and py2exe) have an advantage compared to Nuitka?



At the end of the day you can use whatever you want; who am I to care for that? But I am curious why PyInstaller is still more used when there's (imo) a clearly better option on the table.

/r/Python
https://redd.it/1p46onk
[P] Interactive Advanced Llama Logit Lens

/r/MachineLearning
https://redd.it/1p4akjr