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
A modern Python Project Cookiecutter Template, with all the batteries included.

Hello cool sexy people of r/python,

Im releasing a new Cookeicutter project template for modern python projects, that I'm pretty proud of. I've rolled everything you might need in a new project, formatting, typechecking, testing, docs, deployments, and boilerplates for common project extras like contributing guides, Github Issue Templates, and a bunch more cool things. All come preconfigured to work out of the box with sensible defaults and rules. Hopefully some of you might find this useful and any constructive feedback would be greatly appreciated.

- Github Repo - https://github.com/wyattferguson/cookiecutter-python-uv

# What My Project Does

Everything comes preconfigured to work out of the box. On setup you can pick and choose what extras to install or to leave behind.

- UV - Package and project manager
- Ruff - Linter and code formatter.
- Typechecking with Ty or Mypy.
- Pytest - Testing
- Coverage - Test coverage.
- Nox - Testing in multiple Python environments.
- Taskipy - Task runner for CLI shortcuts.
- Portray - Doc generation and Github Pages deployment.
- GitHub Action to publish package to PyPI.
- GitHub Issue Templates for documentation, feature requests, general reports, and bug reports.
- Pre-commit - Linting, formatting, and common bug checks on Git commits.
- Changelog, Code of Conduct, and Contributing Guide templates.
- Docker

/r/Python
https://redd.it/1lcz532
Top Django Interview QS

Hi!
I am 4years exp person and looking for a career switch my roles is primarily focusing on Django based backend engineering. while preparing my self for an interview I found only basic interview qs available on the internet do you guys know what are the qs mostly people asked during the interview??

Let me know in the comments!! Thanks 🙏🏻

/r/django
https://redd.it/1ld0gut
D Why Is Data Processing, Especially Labeling, So Expensive? So Many Contractors Seem Like Scammers

Honestly, the prices I have seen from data labeling vendors are just insane. The delivery timelines are way too long as well. We had a recent project with some medical data that needed pre-sales labeling. The vendor wanted us to pay them every week, but every delivery was a mess and needed countless rounds of revisions.

Later we found out the labeling company had outsourced the whole task to a group of people who clearly had no idea what they were doing. If your project is small, niche, or long-tail, the bigger vendors do not even want to take it. The smaller teams? I just cannot trust their quality.

Besides being crazy expensive, the labeling is always super subjective, especially for big, complex, or domain-specific datasets. Consistency is basically nonexistent. The turnover at these labeling companies is wild too. It feels like half their team just gets a crash course and then is thrown onto your project. I really cannot convince myself they are going to deliver anything good.

Now I am getting emails from companies claiming their "automated labeling" is faster and better than anything humans can do. I honestly have no clue if that is for real since I have never

/r/MachineLearning
https://redd.it/1ldaof1
Class variable for multiple language support

Is it good idea to use class variable to store all UI text and their translation.

class Text():
data={
'login':{
'en':'login',
'bn':'লগইন'
}#many more
}
@staticmethod
def get(key):
return Text.data[key][lang_from_session()]

@app.context_processor
@staticmethod
def get_jinja():
return dict(Text=Text.get)



#in template
<a href='/login'>{{Text('login')}}</a>



See the example above. I can import Text and use it for translation. Thanks in advance.

/r/flask
https://redd.it/1lcn5wk
Flutter or React Native for Mobile App with Django REST Backend?

Hi all,

We’re developing a warehouse management system with both web and mobile components. The web app is almost done, built using Vue.js for the frontend and Django REST Framework (DRF) for the backend.

Now we're moving to the mobile app, which will have a few core features:

QR code scanning, OTP verification, User login, Delivery status updates, Image uploads (e.g., proof of delivery)

We’re new to mobile development and working with a tight deadline, so our plan is to learn the basics quickly and then vibe code the rest as we build.

We’re trying to decide between Flutter and React Native, and our priorities are:

Easy integration with our existing DRF backend

Quick to learn and develop with

Good support for camera/QR/image features


From your experience, which framework would help us move faster and be more suitable for a small team coming from a web development background?
Any advice or suggestions would be greatly appreciated — thanks!

/r/django
https://redd.it/1ldhoio
What front end frameworks should you learn as a Full Stack Developer?

Do Django full stack developers need to pick a specific front-end framework to stay competitive in the job market?


https://youtu.be/LKhR9KS8eVQ

In this short clip, taken from my recent LinkedIn Live session I answered a common question from developers: “Will choosing one front-end framework give me an edge when job hunting?”

🔍 I talked about what hiring trends are actually showing — While there’s no single “must-know” tool, some front-end technologies are clearly leading the pack.

💡 Based on what I’ve seen in job specs and industry chatter, here are the frameworks worth paying attention to right now:

TypeScript – showing up most frequently in job ads

React – still a dominant choice across the board

Vue.js – strong third place, especially in smaller teams

HTMX – a rising star, particularly popular in the Django world

I also share insights from DjangoCon US, where HTMX generated a lot of buzz, both on stage and in hallway conversations.What Front End frameworks should you learn as a Full Stack Developer

/r/django
https://redd.it/1ldjpqu
Need help with Django Authentication and User Modules

Hi everyone,

Found this sub and figured it's worth a shot. Is anyone willing to spare an hour or two of their time and help me properly set up the authentication and user profiles for a project I'm working on?
I've done some work on it, but the tokens don't seem to be working correctly, and it would be amazing if someone who knows and has worked with both could have a look and walk me through it.
Any input would be so so so appreciated!

/r/djangolearning
https://redd.it/1lctrb3
Best way to minify HTML/CSS/JS in a Django + Tailwind project?

I'm working on a Django project with TailwindCSS (using django-tailwind) and looking for the best way to minify my static files (HTML, CSS, and JS) for production.


I initially tried writing a middleware that uses regular expressions to minify HTML responses (removing whitespace/comments), but then realized this might actually slow down the site instead of improving performance, especially under high traffic.



I also looked into some libraries like django-minify-html, but they also rely on middleware, so I’m concerned about runtime overhead.



Then I thought — maybe I could hook into the build process. Like, when I run:

\- python manage.py tailwind build

\- python manage.py collectstatic



…maybe there’s a way to minify things at that point. But I'm not sure how to do that or what the right approach is.



What's the recommended way to minify static files in a Django + Tailwind project?


ps. Used ChatGPT

/r/django
https://redd.it/1le10ev
Need Help Deploying Django App with Database

Hey everyone,
I'm trying to deploy my Django application, and I'm stuck when it comes to deploying it along with the database (sqlite). I’ve developed everything locally and it's working fine, but I’m confused about how to properly set up the production database (sqlite). I have explored various options like AWS , render but I'm stuck . Also I want it with custom domain.

/r/django
https://redd.it/1ldr31p
Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

/r/Python
https://redd.it/1ld8te6
Django Channels

Hi so i need to implement notifications in my application and I have a few questions about Django channel layer(COuld really use some help here):



1. Does every consumer instance get its own channel layer name ? ( lets say i have 2 websocket URLs mapped to 2 consumers , and every client establishes a connection to both these consumers via the url router )



2. Is the channel layer name uniquely generated only for that specific connection ? and therefore might be different if the same consumer spins up another instance of itself for a connection ?



3. How do i store and access these channel layer names for each user when i need to add them to a group or something . Do i just store them in a database for the duration of the connection and get rid of them after ?

/r/djangolearning
https://redd.it/1lak7cu
I wish all vibe coders used Django...

Batteries included frameworks like Django are massively underrated for indie founders with limited coding knowledge because ... SOMEONE ELSE already solved their security, auth, design patterns etc for them.

I've found it so easy to spin up a new Django project with Cursor, and just get all the basic stuff done before I get to work.

Whereas I've just taken over a 'vibe coded' next.js application from another agency that has no security at all anywhere and I was able to just curl the api endpoints and extract everything.

Not even one of those 'API key in public' situations... just no auth at all...

We need to be louder as a community about the wonderful benefits of starting a project in Django. When I was new to web coding Django saved me as a n00b dev all those years ago by handling that stuff and having easy ways to do it.

It seems that it can also save the AI...

/r/django
https://redd.it/1le6vl0
Django tip Alert Components With Django Cotton

/r/django
https://redd.it/1leg6cn
My open source project gets 1100+ monthly downloads

https://github.com/ivanrj7j/Font

This is a project that i did because of my frustrations with opencv


opencv does not provide you a solution for rendering custom fonts in their image, and i was kind of pissed and looked for libraries online and found one, but that library had some issues, so i created my own.

about the library:

The Font library is designed to solve the problem of rendering text with custom TrueType fonts in OpenCV applications. OpenCV, a popular computer vision library, does not natively support the use of TrueType fonts, which can be a limitation for many projects that require advanced text rendering capabilities.

This library provides a simple and efficient solution to this problem by allowing developers to use custom fonts in their OpenCV projects. It abstracts away the low-level details of font rendering, providing a clean and intuitive API for text rendering.

now when i look into stats, i am seeing almost 1100+ downloads which made me very proud


thats all rant over

/r/Python
https://redd.it/1leazx1
I built a free self-hosted application for effortless video transcription and translation

Hey everyone,

I wanted to share Txtify, a project I've been working on. It's a free, open-source web application that transcribes and translates audio and video using AI models.

GitHub Repository: https://github.com/lkmeta/txtify

Online Demo: Try the online simulation demo at Txtify Website.

What My Project Does

Effortless Transcription and Translation: Converts audio and video files into text using advanced AI models like Whisper from Hugging Face.
Multi-Language Support: Transcribe and translate in over 30 languages.
Multiple Output Formats: Export results in formats such as .txt, .pdf, .srt, .vtt, and .sbv.
Docker Containerization: Now containerized with Docker for easy deployment and monitoring.

Target Audience

Translators and Transcriptionists: Simplify your workflow with accurate transcriptions and translations.
Developers: Integrate Txtify into your projects or contribute to its development.
Content Creators: Easily generate transcripts and subtitles for your media to enhance accessibility.
Researchers: Efficiently process large datasets of audio or video files for analysis.

Comparison

Txtify vs. Other Transcription Services

High-Accuracy Transcriptions: Utilizes Whisper for state-of-the-art transcription accuracy.
Open-Source and Self-Hostable: Unlike many services that require subscriptions or have limitations, Txtify is FREE to use and modify.
Full Control Over Data: Host it yourself to ensure privacy and security of your data.
Easy Deployment with Docker: Deploy easily on any platform without dependency headaches.

Feedback Welcome

Hope you find Txtify useful! I'd love to

/r/Python
https://redd.it/1lebqvx
opentemplate - FOSS Python template focused on developer experience, security and SOTA tooling

## What the project does?

opentemplate (https://github.com/open-nudge/opentemplate) is an easy to use, yet comprehensive Python template (single click and single command is more or less all that is needed, use as a GitHub template).

Some features (see the repo for more):

- Truly open source: no tokens, no fees, no premium plans
- Easy: clone templated repo, run pdm setup
- SOTA: best checkers for Python, YAML, Markdown, prose and more
- Secure: SLSA Level 3, SBOMs, attestations and more
- Consistent: all pipelines defined by pyproject.toml

## Target audience

Anyone creating Python projects, tested intensively (including pipelines), especially for a template repository, initial release, but likely mature enough for production

## Comparison

Detailed section provided in the docs (here: https://open-nudge.github.io/opentemplate/latest/template/about/comparison/), but briefly:

- Python-first
- Focused mainly on developer experience
- GitHub only (no external platforms necessary)
- No paid tiers, fully free (some security features are blocked for private repositories, but that is on the GitHub's side and probably for a longer post)

## Final thoughts

Happy to hear feedback and if you find it useful/interesting feel free to share/star, thank you in advance.

PS. Might be slow to respond due to poor internet connection today :(


/r/Python
https://redd.it/1lelh8a
Best YouTube Project-Based Tutorials for Django + DRF + React Full-Stack Apps?

Hey everyone,
I'm currently learning Django and really enjoying it. Now I want to level up by learning Django REST Framework (DRF) and how to connect a Django backend with a React frontend.

I learn best by doing, so I'm looking for solid project-based tutorials on YouTube that walk through building a full-stack app using Django + DRF on the backend and React on the frontend.

If you’ve come across any great resources or playlists that helped you, I’d love to hear about them. Thanks in advance!

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