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
Keeping Azure Blob synchronised with Django Database

This is the Image Model for a Gallery app. I realised that the default behaviour of django-storages is that it uploads files to AzureBlob but doesn't delete the files when the database entry is deleted. Not sure if this is the way to do it? It seems like it should be really common but I've had to dig up the AzureBlob SDK manually to do it. I also have a thumbnail function for faster loading (will change some parameters later)

class Image(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    title = models.CharField(max_length=255)
    description = models.TextField()
    image_file = models.ImageField(upload_to='images/')
    thumbnail_file = models.URLField(null=True, blank=True)  # Store Azure URL instead of ImageField
    uploaded_at = models.DateTimeField(auto_now_add=True)

    def save(self, *args, **kwargs):       


/r/django
https://redd.it/1j8i62i
Launched a hosting platform optimized for Django deployment

Hey, I'm Isaac. I've been deploying Django apps for years, and one thing that always annoyed me is how expensive it is—especially if you have multiple small projects.



The problem:

1. Paying for idle time – Most hosting options charge you 24/7, even though your app is idle most of the time.

2. Multiple apps, multiple bills – Want to deploy more than one Django service? Get ready to pay for each, even if they get minimal traffic.



I built Leapcell to fix this. It lets you deploy Django apps instantly, get a URL, and only pay for actual usage. No more idle costs.



If you’ve struggled with the cost of Django hosting, I’d love to hear your thoughts!

Try Leapcell: **https://leapcell.io/**

/r/django
https://redd.it/1j8mftd
Your notes on Django Fundamentals

Does anyone here have an organised notes that you have written on Django Fundamentals while you learned it? And if you did could you please share it. It’ll be useful for me to refer and also update my existing notes.

/r/djangolearning
https://redd.it/1j5kmk0
What are the best linters and language servers for python?

I am confused at the different language servers, linters, and formatters available. Here is what I have been able to figure out, is this correct?

Ruff is a linter / code formatter. It has overtaken Black and Flake8 as the best / most popular. Rust.\
\
JEDI is a library (~~but not a language server?~~) that supports autocompletion, goto, and refactoring.

Pyright is a language server maintained by Microsoft. It supports type checking, goto, autocomplete, similar to JEDI. It is written in TypeScript. I think Pylance is technically the language server and Pyright is the type checker (??)

MyPy is also a language server. It is considered slower and less fully featured than Pyright. It is used primarily because it supports plugins, such as for Pydantic and Django. It was started in 2012 and is written in Python.\
\
PyLSP/Python LSP Server is another language server but it requires another implementation such as JEDI to work. I am not sure what the advantages/disadvantages of it are.\
\
Some commercial IDEs like PyCharm use their own linters and type checkers.\
\
I use the Helix editor and by default it will use Ruff, JEDI, and pylsp together. While it works great,

/r/Python
https://redd.it/1j8bd2n
The best CI/CD strategy with Django App

Hi everyone! I've launched the personal project based on django and untill the last moment, after some updates I just log in to the server and update everything on my own via ftp, and then just restart gunicorn, which was fine until now. Since it starts being hard to manage project in such a way, there is a need to implement CI/CD for it, so i would really like to get an advise from expirienced (or who has dealt with it at least) developers, what are the best steps to do that without Docker (in case of Docker everything is kinda clear), but with Git for sure

The questions ISN'T about certain CI/CD tool or piece of code, but just about strategy. I definitely reffered to SO, but it's all about specific issues with particular pieces of advise.

Ideally, i would like to see the following: there is a stable version (should it be another branch or just a generated folder with timestamp? - also the question), there is a new version with features - I deliver it with job to the server and if everything is ok - mark it as stable, if it's not - to rollback to previous one.

/r/django
https://redd.it/1j8qbt1
I built a simple Terminal UI for pytest, feedback welcome!

# What My Project Does

I missed an easy, simple and quick way to run pytests in the terminal.

Link to project: https://github.com/0-sv/pytesttui.

My project lets you run `pytesttui` in your terminal. After opening, it shows you a tree of all your tests in the tests directory. Still in an early stage, so all it does is if you hit "r" and selected your test, it will run it. It scaled in the repository I use at work which contains about 500 tests. It is more efficient than running it in an IDE because it runs instantly, which is why I like terminal UIs.

If you'd like to try it and you have a Macbook, then visit my github page and download the release. Extract the files and place it in a PATH location like \~/.local/bin. You will probaby have to accept a security warning by MacOS, which is done by browsing to the "Privacy & Security" tab in settings and clicking on "Allow anyway" after running it. Make sure `pytest` is also accessible in a PATH location or installed using pip.

# Target Audience

This is meant as a toy project and just to get some feedback, and if there's enough attention, then I will keep

/r/Python
https://redd.it/1j8qdqa
Nested Images in Wagtail

I have noticed by default images break the list structure and is inserted outside of the list. Is it possible to have nested images within a list item in Wagtail?

/r/django
https://redd.it/1j8t0fe
Turtle.py app to demo RGB color values

* What My Project Does

I've been working on turtle-related projects and I needed a simple, interactive, single-file Python program to explain RGB color values. I wrote this one up as part of my work writing [a Simple Turtle Tutorial written in Wikipedia-style Simple English](https://github.com/asweigart/simple-turtle-tutorial-for-python/) so it can be translated to non-English languages.

The app has three sliders for the amount of red, blue, and green for the window's background color. The RGB values are presented under the sliders for the 0.0 to 1.0 scale, 0 to 255 scale, and hexadecimal 0x00 to 0xFF scale. You can drag the sliders or click on the slider lines directly. There are also 14 preset color buttons along the top to click on.



PyPI page: https://pypi.org/project/turtlecolors/

GitHub repo: https://github.com/asweigart/turtlecolors

Install with `python -m pip install turtlecolors` on Windows or `python3 -m pip install turtlecolors` on macOS/Linux.

Run with `python -m turtlecolors` on Windows or `python3 -m turtlecolors` on macOS/Linux. Or run the code `import turtlecolors;turtlecolors.main()`

When the program first runs, it also prints out the color name strings that Python's turtle module uses. Unlike other lists of color names, I actually checked my list against the turtle.py to make sure they're correct. (I'm pretty sure clickbait articles just use chatgpt

/r/Python
https://redd.it/1j8yyc0
My flask open source alternative to Nexcloud !

I created an alternative to Nexcloud with flask, I'm really proud of myself honestly.

The goal is to be able to host a cloud storage service at home and control 100% of our files etc..

It's easy to use + compatible with linux and windows!

What do you think? Here's the github repo, it's open source and totally free.
https://github.com/Ciela2002/openhosting/tree/main

/r/flask
https://redd.it/1j8zg9j
Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

/r/Python
https://redd.it/1j95o1i
I didn't want to go, but PyCharm finally drove me into the arms of VSCode, after 5+ years.

I just switched to VSCode after well over five years with PyCharm. I didn't want to do it, but I just can't stand it anymore.

Things I love about PyCharm and will miss

1. The refactoring functionality. VSCode's Python extension has that too, but it isn't as nice.

At this point, that's pretty much it.

Things that drove me nuts

1. IdeaVim. It actually got better recently, but for years and years, the undo function was busted, so you had to hit u over and over to undo what in real vim is a single operation. VSCode's neovim plugin uses actual neovim under the hood, which is obviously so much more robust and faithful, while IdeaVim will never be a full implementation.
2. The gradual accumulation of simple bugs that never get fixed.
3. It's so slow. I didn't appreciate just how slow until I switched over to VSCode. I mean, holy crap, it's 10x faster for a lot of things (opening a project, installing or restarting extensions, for example).

Here are the bugs that have bugged me the worst:

The "usages" window (cmd-click on a definition, see where it's used) constantly resizes itself too small. It's been a problem for years. They won't fix the way autosize

/r/Python
https://redd.it/1j9196v
Ascii Video Player

Hello People!
A few months ago, I built an ASCII video player that converts any video into an ASCII art version (with audio support). Back then, I didn’t have the confidence to share it, but now I’ve decided to put it out there!

What My Project Does

ASCII-Flix lets you watch videos directly in your terminal by converting frames into ASCII characters, creating a retro, text-based viewing experience. It supports 2 modes for different ASCII rendering styles and plays the original audio alongside the video.

I used OpenCV, python-curses, and Pygame(for audio support) .

Target Audience:

This project is for anyone who enjoys creative terminal-based projects, ASCII art enthusiasts, and people who like experimenting with unconventional ways of watching videos. If you’re into tech nostalgia, retro computing aesthetics, or just want to try something fun in your terminal, you’ll probably enjoy this!

Comparison:

This was inspired by ASCII Theatre, which allows you to watch movies in ASCII art format in the terminal. However, ASCII Theatre is a more refined version of this concept. ASCII-Flix, on the other hand, is something I made for fun—it’s a lighthearted experiment that brings a unique way to experience videos in ASCII form.

How to use it:
1. pip install ascii-flix
2. Type the command ascii-flix on your

/r/Python
https://redd.it/1j96mku
Need help with authentication

I am currently working on a project with django rest api and react js. I am confused in selecting a proper authentication method. It's a small internal web based app that would only be used within the company and targeting less than 60 users.
Should I go for jwt based authentication or try to implement session based authentication. Even though I have experience in the backend Development, I am used to code in jwt based authentication since we had a react native based app.
Does jwt have any security issues?
If session authentication is better how can I make it work with react js. I remember trying this few years back and cookies were not working when on different domains. I am planning to dockerize entire thing. Will the session work properly then?

Nb: I have been working on spring boot project for few years. My first few years was with django. Returning to django now.

/r/django
https://redd.it/1j93kwy
MVP codeStructure suggestion for CLOUDWISE(my multiple cloud APP)

Starting a 15-day MVP to manage AWS resources via natural language. Any tips for structuring a Flask project with multiple cloud provider integrations?

/r/flask
https://redd.it/1j989y5
LambdaLabs: Create HTTP routes, lambdas and databases in runtime.

What My Project Does:
LambdaLabs is a small-scale, hobby and proof-of-concept project that enables dynamic creation of routes, serverless lambdas, and databases. It runs over FastAPI with almost no performance overhead.

Target Audience:
Currently this project is just a toy / hobby project for getting more into python.

The goal with this project was to build a small-scale, lightweight application that allows the same power as FastAPI without introducing overhead usually associated with these kind of applications.


https://github.com/joexbayer/LambdaLabs

/r/Python
https://redd.it/1j9fqu1
We launched serverless hosting option for Flask apps

Hey r/flask ,

I’ve been deploying Flask and Django apps for years, and one thing that always frustrated me is the cost—especially for small projects that don’t get much traffic.

# The problem:

Paying for idle time – Most hosting providers charge 24/7, even if your app is mostly idle.
Multiple apps, multiple bills – Want to run a few small services? You’ll likely pay for each one separately, even if they barely get used.

I wanted a more efficient way to host Flask apps, so I built Leapcell—a serverless option that deploys instantly, gives you a URL, and only charges for actual usage (no idle costs).

If you’ve struggled with the cost of Python hosting, I’d love to hear your feedback!

Try Leapcell: **https://leapcell.io/**

/r/flask
https://redd.it/1j9fhhk
13 Months into Django - Built a Boilerplate to Share

I started learning Django 13 months ago and I really enjoy it. I've been building web apps and improving my skills ever since.

The more I built, the more I noticed setup was eating my time: auth, payments, same old grind.

So I put together a little boilerplate to skip the hassle - Django with HTMX, Tailwind + Kutty, Stripe, Wagtail, Django-Allauth all ready in 15 minutes.

It’s been a time-saver for me, and a couple friends didn’t hate it. Figured I’d share with the community that got me started.

Here's the repo if you're curious

/r/django
https://redd.it/1j9jyc4
For Hire Full Remote Software engineer with 6+ years of experience

I’m a Software Engineer with over 6 years of experience - including YC backed startups as founding engineer - building scalable systems, crafting high-performance backends, LLM based features and delivering impactful AI/ML-driven solutions.

I've worked on everything from scaling products to millions of users at startups to optimizing workflows in enterprise environments.

Open to consulting gigs and full time roles.

Tech Stack

Languages — Python, JavaScript, Typescript

Frameworks & Packages — Django, React

Datastores & Caches — PostgreSQL, Redis, RabbitMQ, Kafka, DynamoDB

Deployment Tools — Docker, Docker Compose

Cloud providers — AWS, GCP

Feel free to comment or DM.

/r/django
https://redd.it/1j9q4cs
ZipNN: High-Speed Compression for AI Models

📌 **Repo:** [GitHub - zipnn/zipnn](https://github.com/zipnn/zipnn)

# 📌 What My Project Does

ZipNN is a compression library designed for **AI models, embeddings, KV-cache, gradients, and optimizers**. It enables storage savings and **fast decompression on the fly**—directly on the CPU.

* **Decompression speed**: Up to **80GB/s**
* **Compression speed**: Up to **13GB/s**
* Supports **vLLM & Safetensors** for seamless integration

# 🎯 Target Audience

* **AI researchers & engineers** working with **large models**
* **Cloud AI users** (e.g., Hugging Face, object storage users) looking to optimize **storage and bandwidth**
* **Developers handling large-scale machine learning workloads**

# 🔥 Key Features

* **High-speed compression & decompression**
* **Safetensors plugin** for easy integration with vLLM:pythonCopyEditfrom zipnn import zipnn\_safetensors zipnn\_safetensors()
* **Compression savings**:
* **BF16**: 33% reduction
* **FP32**: 17% reduction
* **FP8 (mixed precision)**: 18-24% reduction

# 📈 Benchmarks

* **Decompression speed:** 80GB/s
* **Compression speed:** 13GB/s

# Why Use ZipNN?

* **Faster uploads & downloads** (for cloud users)
* **Lower egress costs**
* **Reduced storage costs**

# 🔗 How to Get Started

* **Examples:** [GitHub - ZipNN Examples](https://github.com/zipnn/zipnn/tree/main/examples)
* **Docker:** [ZipNN on DockerHub](https://hub.docker.com/r/zipnn/vllm-openai)

ZipNN is seeing **200+ daily downloads on PyPI**—we’d love your feedback! 🚀

/r/Python
https://redd.it/1j9hype