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
Modelling Vasculature through BARWs

Hey guys, I need some advice about modelling branching and annihilation random walks (BARWs) in python. I use VS Code for my coding and I'm just a beginner at python. How do people usually model random walks and what are some parameters that people include? Also, there's a lot of math related to branching, growth and termination. How do people usually add ordinary differential equations as boundary conditions and such on python ?

/r/Python
https://redd.it/1lf4djo
Early publish: django-bootyprint

Hey,

this is an early release.

I discovered this week that weasyprint (pdf generation) is capable of flex display. I have a lot of table based layouts for weasyprint, and i thought about a "weasyprint bootstrap" for a long time.

So while i got some spare time this week, i worte BootyPrint a sass css framework for weasyprint that has bootstrap in mind.

Here comes django into play - as a companion, i published django-bootyprint, which is nothing more as a weasyprint renderer with the current version of BootyPrint.

This project will grow in the next days, i'm planning to add simple font loading, as is use this package for my fantasy rpg book creation: https://public.phasesix.org/media/rulebookpdf/bookpdfenlHaGBdw.pdf

Any hint what a pdf rendering library for django could do to make our lifes easier is appreciated!


/r/django
https://redd.it/1lfmnfh
P I built a self-hosted Databricks

Hey everone, I'm an ML Engineer who spearheaded the adoption of Databricks at work. I love the agency it affords me because I can own projects end-to-end and do everything in one place.

However, I am sick of the infra overhead and bells and whistles. Now, I am not in a massive org, but there aren't actually that many massive orgs... So many problems can be solved with a simple data pipeline and basic model (e.g. XGBoost.) Not only is there technical overhead, but systems and process overhead; bureaucracy and red-tap significantly slow delivery.

Anyway, I decided to try and address this myself by developing FlintML. Basically, Polars, Delta Lake, unified catalog, Aim experiment tracking, notebook IDE and orchestration (still working on this) fully spun up with Docker Compose.

I'm hoping to get some feedback from this subreddit. I've spent a couple of months developing this and want to know whether I would be wasting time by contuining or if this might actually be useful.

Thanks heaps

/r/MachineLearning
https://redd.it/1lfbq3m
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/1lfpxzq
Django Email

What Email Service Provider do you use for your Django Apps?

Any noticeable pros/cons with using them?

/r/django
https://redd.it/1lfk4xe
Build a search engine using Django

I build a search engine using Django and deployed yesterday. My platform vastvids is the only url that’s been added to be scraped so only results from it pop up. I was wondering if you guys could check it out and add your sites to be indexed as well.

URL:
vastwebscraper

/r/django
https://redd.it/1lf7i3j
Free University Course: Python

Want a Python course for FREE? 🐍 Here are 5 elite university courses you can start today:

- Harvard’s CS50 Python

- MIT’s Intro to CS with Python

- Stanford’s Programming Methodology

- Michigan’s Python for Everybody

- CMU’s Principles of Computation

/r/Python
https://redd.it/1lflhjk
Best books for learning Django + React

Please tell if any other frontend is more popular for jobs.

/r/djangolearning
https://redd.it/1lfxjq7
I am new to django

Ok so same as the title , i am new to django but i have some prior experience of backend using node.js . But now i am confused what to do and from where i can go ahead . I have been following a django 10hr lecture video from freecodedamp but now i am confused what to do ahead of it . Also im a pre junior year student so i really need to go in depth for this as i need an internship in this domain .

/r/djangolearning
https://redd.it/1lg1poq
Looking for Chemistry Enthusiasts for NeurIPS Open Polymer Prediction 2025 (Kaggle)

Hi everyone,

I'm participating in the NeurIPS - Open Polymer Prediction 2025 competition on Kaggle and looking to team up with folks who have a strong background in chemistry or materials science.

If you're into polymer behavior, molecular properties, or applied ML in materials, this could be a great opportunity to collaborate and learn together.

Drop a comment or DM if you're interested to participate🔬💥

/r/Python
https://redd.it/1lg1m6g
New fastest HTML parser

Hello there, I've created a python bindings to html c library reliq.

https://github.com/TUVIMEN/reliq-python

It comes in pypi packages that are compiled for windows, x86 aarch64 armv7 linux, and macos.

# What My Project Does

It provides a HTML parser with functions for traversing it.

Unfortunately it doesn't come with standardized selector language like css selectors or xpath (they might get added in the future). Instead it comes with it's own, which you can read about in the main lib (full documentation is in a man page).

Code example can be seen here.

# Target Audience

This project has been used for many professional projects e.g. forumscraper, 1337x-scraper, blu-ray-scraper, all of which are scrapers, and thats it's main use.

# Comparison

You can see benchmark with other python libraries here.

For anyone wondering where does the speed and memory efficiency come from - it creates parsed structure in reference to original html string provided. If html string changes, entire structure has to be reparsed to match it.

This comes with limitation unique only to this library - although possible, any functions changing html structures aren't implemented. This however is useful only for browsers ;)

/r/Python
https://redd.it/1lganqg
I learnt to send notifications from django. Does anyone need a tutorial?

I had posted a question about how to setup notifications in django a month ago.

After reading the documentation in detail and using chatgpt while doing steps, I found a way to do it. So now I'm able to send notifications from shell, and save tokens.

The point is, it's a complicated process, good tutorials for the same are 4-5 years old, and methods of doing it are changed. I asked chatgpt, GitHub copilot to do it for me but didn't work.

Hence I think, I can make an English tutorial on that topic on youtube if people need it. Let me know in the comments.

P.S. By notifications I mean push notifications, and tokens mean firebase cloud messaging (fcm) tokens.

/r/django
https://redd.it/1lg1rv0
Social login recommendations

Hi! I wanna implement social login for my API (DRF). Initially will start with google, latter Apple. Which package would you recommend? Any good tutorial? Many thanks

/r/django
https://redd.it/1lgiclj
Flask sqlalchemy Lost Connection error driving me crazy!

So I've been bumping into this issue for months now, I've researched and tried so many methods online, but still no luck! I use flask_login, sqlalchemy to control my user logins. But frequently I get an "Internal Error", with the exception:

(pymysql.err. OperationalError) (2013, 'Lost connection to MySQL server during query') [SQL: SELECT users_1dap. id AS users_Idap_id, users_ ldap. username AS users_ ldap_username, users_ 1dap. name AS users_ ldap_name, users_ ldap. email AS users_ldap_email, users_ 1dap. role AS users_Idap_role, users_ 1dap. status AS users_Idap_status, users_1dap. atype AS users_ 1dap_atype, users_ ldap. group_name AS users_Idap_group_name, users_Idap. created_on AS users_ 1dap_created_on, users_1dap. last_ login AS users_1dap_last_ login

I didn't write this query, it's being used by Flask-Login I think.

MySQL version: 8.0
SQLAlchemy: 2.0.37
PyMySQL: 1.1.1
Flask-Login: 0.6.3
Flask-SQLAlchemy: 3.1.1

I also tried to change SQLALCHEMY_POOL_RECYCLE to 100, the wait_timeout is 1800 on the server.

Any advice would help :(



/r/flask
https://redd.it/1lg8hts
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/1lgiy3h
Wrote an MIT-licensed book that teaches nonprofits how to use Python to analyze and visualize data

## What My Project Does:

I have enjoyed applying Python within the nonprofit sector for several years now, so I wanted to make it easier for other nonprofit staff to do the same. Therefore, I wrote Python for Nonprofits, an open-source book that demonstrates how nonprofits can use Python to manage, analyze, visualize, and publish their data. The GitHub link also explains how you can view PFN's underlying Python files on your computer, either in HTML or Jupyter Notebook format.

Topics covered within PFN include:

1. Data import
2. Data analysis (including both descriptive and inferential stats)
3. Data visualization (including graphs and maps)
4. Sharing data online via Dash dashboards and Google Sheets. (Static webpages also get a brief mention)

PFN makes heavy use of Pandas, Plotly, and Dash, though many other open-source libraries play a role in its code as well.

## Target Audience (e.g., Is it meant for production, just a toy project, etc.

This project is meant for individuals (especially, but not limited to, nonprofit workers) who have a basic understanding of Python but would like to build up their data analysis and visualization skills in that language. I also hope to eventually use it as a curriculum for adjunct teaching work.

## Comparison: (A

/r/Python
https://redd.it/1lgmr2b
Design Patterns You Should Unlearn in Python-Part2

Blog Post, NO PAYWALL

design-patterns-you-should-unlearn-in-python-part2

---

After publishing Part 1 of this series, I saw the same thing pop up in a lot of discussions: people trying to describe the Singleton pattern, but actually reaching for something closer to Flyweight, just without the name.

So in Part 2, we dig deeper. we stick closer to the origal intetntion & definition of design patterns in the GOF book.

This time, we’re covering Flyweight and Prototype, two patterns that, while solving real problems, blindly copy how it is implemented in Java and C++, usually end up doing more harm than good in Python. We stick closely to the original GoF definitions, but also ground everything in Python’s world: we look at how re.compile applies the flyweight pattern, how to use lru_cache to apply Flyweight pattern without all the hassles , and the reason copy has nothing to do with Prototype(despite half the tutorials out there will tell you.)

We also talk about the temptation to use __new__ or metaclasses to control instance creation, and the reason that’s often an anti-pattern in Python. Not always wrong, but wrong more often than people realize.

If Part 1 was about showing that not every pattern needs to be translated into Python, Part

/r/Python
https://redd.it/1lgrlza
Any toolkit or boilerplate to convert Django web app into a mobile app (React Native or Capacitor)?

Fellow Django Developers I'm a bit of Django dev myself and I’m wondering if there’s a curated toolkit or service that can help me convert an existing Django web application into a mobile app — ideally using something like React Native, Capacitor, or similar — without having to dive deep into frontend/mobile frameworks

I'm mainly looking for:

* A boilerplate that connects Django (with DRF or GraphQL)
* A minimal mobile frontend (even WebView is fine if it's production-grade)
* Support for login/auth, navigation, API calls, and mobile packaging

Any recommendations or links would be much appreciated!

Thanks!

/r/djangolearning
https://redd.it/1leypt7
Transform the Way You Build Django Apps – My First Open Source Library Is Here!

Hey guys 👋

After years of working with Django, I’ve always appreciated its robustness and flexibility — but one thing always felt missing: a **powerful developer-friendly CLI**.

When I started exploring frameworks like **NestJS**, **AdonisJS**, and **Laravel**, I was seriously impressed by how fast you could scaffold files, enforce structure, and streamline development with just a few commands. That kind of DX (developer experience) is incredibly powerful.

So I thought… **why not bring that same energy to Django?**
That’s how [`django-smartcli`](https://pypi.org/project/django-smartcli/) was born — my very first open-source Python library! 🎉

# 🧰 What it does

`django-smartcli` helps you generate Django boilerplate with intuitive commands like:

django-smartcli create-model Product my_app

This automatically creates a `models/product.py` file with a ready-to-use model class, UUID primary key, timestamps, soft delete, and more — all following best practices.

Save time
Avoid repetitive boilerplate
Promote clean & consistent structure

# 💡 Why I built it

* Inspired by NestJS / AdonisJS / Laravel CLI tools
* To make building Django apps faster and more enjoyable
* To learn how to build and publish a real Python package
* To help others adopt a clean microservice architecture in Django

# 📦 Try it out

pip install django-smartcli

Then

/r/django
https://redd.it/1lgx9ol
🔗 Built my first Django URL Shortener with Analytics & QR Codes - Looking for feedback! [LinkFusion]

Hey r/django!

I've been working on a URL shortener app called LinkFusion and would love to get some feedback from the community. This is my another major Django project, so any suggestions would be greatly appreciated! [https://github.com/manjurulhoque/link-fusion](https://github.com/manjurulhoque/link-fusion)

# 🚀 What it does:

* Shorten URLs: Turn long URLs into branded short links
* Custom Domains: Users can add their own domains
* Password Protection: Secure links behind passwords
* QR Code Generation: QR codes for shortened link
* Analytics Dashboard: Track clicks, locations, devices, and browsers
* Link Expiration: Set expiration dates and click limits
* Admin Panel: Full admin dashboard for managing users and links

# 🛠️ Tech Stack:

Pure Django Setup:

* Django 5.0+ (Python web framework)
* SQLite database
* Django Templates + django-tailwind for styling
* Class-based views and function-based views
* Django ORM for all database operations
* AlpineJS

Key Libraries:

* qrcode + Pillow for QR code generation
* user-agents for device/browser detection
* requests for IP geolocation
* python-decouple for environment management

# 📊 Django Features I'm Using:

* Models: ShortenedURL, Click, Domain, UserProfile, QRCode
* Views: Mix of CBVs and FBVs for different functionality
* Forms: Django forms with validation for link creation
* Admin: Custom admin interface with analytics
* Templates: Responsive templates with Tailwind CSS
* Authentication: Built-in Django auth system
* Middleware: Custom analytics tracking

# 📈 Cool Django Implementation Details:

* Custom generate\_short\_code() function for unique URLs
* Custom template tags for analytics formatting
* Proper model relationships with foreign keys
* Django's built-in pagination for link lists
* Form validation with custom clean methods

# 📸 What the Django templates look like:

[Home](https://preview.redd.it/stpqp5sbi98f1.png?width=1850&format=png&auto=webp&s=004649c8302a4abb8ff12c02baceb9a5c5c37abc)

[Dashboard](https://preview.redd.it/wbbq5kcfi98f1.png?width=1850&format=png&auto=webp&s=3832385c091f44d23d3cdf267e26fc9fc3d4716a)

[Domain](https://preview.redd.it/bz63y40ll98f1.png?width=1850&format=png&auto=webp&s=cdc5abf06373d0fd528397785080d86004b1c231)

[QR Code](https://preview.redd.it/7vt9ywvnl98f1.png?width=1850&format=png&auto=webp&s=195ed89973ca8a3df9e0ac82efabd7ac8b6921c2)

Thanks for checking it out! 🙏

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