PythonHub
2.5K subscribers
2.35K photos
49.7K links
News & links about Python programming.
https://pythonhub.dev/
Download Telegram
django-polymorphic - Polymorphic models in Django

The video explains Django model inheritance and polymorphic models, showing how django-polymorphic returns the correct subclass types when querying a base model through the ORM. It also covers Django Admin support and integrations with other Django ecosystem packages to make polymorphic models easier to manage.

https://www.youtube.com/watch?v=d8MC2FQ_nqU
7 Things You Didn’t Know Dataclasses Could Do

The video walks through seven lesser-known features of Python’s dataclasses that make code safer, clearer, and easier to maintain, beyond basic use. Each tip shows how dataclasses can reduce boilerplate and improve common patterns in everyday Python code.

https://www.youtube.com/watch?v=YTsJQ4ixq88
Asyncio Finally Got Peewee

Charles Leifer introduces an asyncio compatibility layer for the Peewee ORM that uses greenlet to bridge synchronous database logic with asynchronous event loops without requiring a full codebase rewrite. This implementation allows developers to run standard Peewee queries and transactions within async contexts by using a task-local state management system and specific execution helpers ...

https://charlesleifer.com/blog/asyncio-finally-got-peewee/
Django Time-Based Lookups: A Performance Trap

The article shows how certain Django time-based field lookups can bypass database indexes and turn a simple filter into a full table scan, dramatically slowing queries. It then demonstrates a much faster pattern by computing time boundaries in Python so the database can use the existing index and drop execution time from tens of seconds to under a second.

https://johnnymetz.com/posts/django-time-based-lookups-performance/
Speeding up Pillow's open and save

The author benchmarks and improves Pillow’s image open/save performance by avoiding unnecessary plugin imports and using lazy loading, leading to large speed gains in Python. Results show opening PNG images can be around 2.6 times faster and WebP up to 14 times faster, with similar improvements in saving images, and the changes are included in upcoming Pillow releases.

https://hugovk.dev/blog/2026/faster-pillow/
Let's Build Pipeline Parallelism from Scratch

The tutorial walks through building pipeline parallelism from the ground up, explaining how to split large AI models and training workloads across multiple GPUs to improve training efficiency. It breaks down concepts with step-by-step examples so developers can understand how data and compute are partitioned and coordinated in a distributed training system.

https://www.youtube.com/watch?v=D5F8kp_azzw
I created a game engine for Django?

The author built a multiplayer Snake game in the browser using only Python and Django LiveView, with no custom JavaScript, by keeping game state on the server and broadcasting rendered HTML over WebSockets.

https://en.andros.dev/blog/6e9e4485/i-created-a-game-engine-for-django/