pythondaily | Education

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Subscribe to a channel

Python Daily

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

Читать полностью…

Python Daily

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

Читать полностью…

Python Daily

Best source to learn Django?

can someone advise me?

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

Читать полностью…

Python Daily

How global variables work in Python bytecode

Hi again! A couple weeks ago I shared a post about local variables in Python bytecode, and now I'm back with a follow-up on globals.

Global variables are handled quite differently than locals. Instead of being assigned to slots, they're looked up dynamically at runtime using the variable name. The VM has a much more active role in this than I expected!

If you're curious how this works under the hood, I hope this post is helpful: https://fromscratchcode.com/blog/how-global-variables-work-in-python-bytecode/

As always, I’d love to hear your thoughts or questions!

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

Читать полностью…

Python Daily

Anyone using MCP to connect Cursor to Django Backend?

I would love to have Cursor just aware of all models as well as the current runserver output so it can see when a change is throwing an error.

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

Читать полностью…

Python Daily

Type hinting g and session is there to make life easier.

Many of you may already know this. But discovering it makes my life easier. Accessing value in g is troublesome. On the other hand IDE can not help on the object returned by g. So i made a G_mngr which solve this problem.

from flask import g
from typing import TYPE_CHECKING, Optional
if TYPE_CHECKING:
from yourpkg.database.user_model import User


class G_mngr():
@property
def user(self)->Optional['User']:
return g.get('user',None)

@user.setter
def user(self, value):
g.user = value

G=G_mngr()

import G in other module, you can now easily use G.user and IDE can help you with all the suggestion about user and its attributes. Same goes to session.

/r/flask
https://redd.it/1lcslhp

Читать полностью…

Python Daily

Need a little guidance

Hey, I’m a beginner Django programmer. I’ve been working with Django for the past 3 months and have built a few projects like a task manager, PDF generator, email sender, etc. I’m currently stuck on the Django REST framework — not understanding much of it. I’m more of a hands-on/project-based learner; watching lectures doesn’t really work for me. I’m hoping a real Django developer could guide me a bit — not looking for an internship, certification, or anything formal, just some guidance. I’d be really greatful.



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

Читать полностью…

Python Daily

SaaS opportunity

I am a 17 year old full time Django developer at a digital company based in the Uk, and a while ago me and my friend decided to put our skills to use by starting a SaaS side project built with Django. We have got a MVP pretty much developed

I am looking for a Django developer(s) who would be interested in joining us.

We are applying for funding which would massively help and therefore we would like another developer to accelerate development and hopefully it can turn into something more full time in the future if all goes well.

I know it’s not the most lucrative opportunity but if you like to learn and develop Django, and are enthusiastic about development you might enjoy it.

Please DM or comment if you are interested

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

Читать полностью…

Python Daily

PySpring - A Python web framework inspired by Spring Boot.

I've been working on something exciting - PySpring, a Python web framework that brings Spring Boot's elegance to Python. If you're tired of writing boilerplate code and want a more structured approach to web development, this might interest you!

\- What's cool about it:

* Auto dependency injection (no more manual wiring!)
* Auto configuration management
* Built on FastAPI for high performance
* Component-based architecture
* Familiar Spring Boot-like patterns
* Recent PRs:
* [Route Mapping Decorators Implementation #3](https://github.com/PythonSpring/pyspring-core/pull/3)
* [Add Support for Qualifiers and Component Registration Validation](https://github.com/PythonSpring/pyspring-core/pull/1)
* GitHub: [https://github.com/PythonSpring/pyspring-core](https://github.com/PythonSpring/pyspring-core)
* Example Project: [https://github.com/NFUChen/PySpring-Example-Project](https://github.com/NFUChen/PySpring-Example-Project)

Note: This project is in active development. I'm working on new features and improvements regularly. Your feedback and contributions would be incredibly valuable at this stage!If you like the idea of bringing Spring Boot's elegant patterns to Python or believe in making web development more structured and maintainable, I'd really appreciate if you could:

* Star the repository
* Share this with your network
* Give it a try in your next project

Every star and share helps this project grow and reach more developers who might benefit from it. Thanks for your support! 🙏I'm actively maintaining this and would love your feedback! Feel free to star, open issues, or contribute. Let me know what you

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

Читать полностью…

Python Daily

Is that possible?

Is that possible to write a python web-based system that performs security testing, just like a terminal-based tool?

/r/flask
https://redd.it/1ladx9c

Читать полностью…

Python Daily

Best logging strategy

Currently, I’m logging the entire request and response, including the body. However, this is consuming too much storage and network bandwidth. Is it necessary to log all the details of a request cycle, or is there a recommended strategy to reduce this overhead? I want to make sure that it doesn't become a blind spot in case of an attack.

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

Читать полностью…

Python Daily

Why most of Django repos don't have a license file in Github?

Same as title.
It makes impossible to use it for projects because unlicensed repos are closed source.

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

Читать полностью…

Python Daily

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/1lbmt5u

Читать полностью…

Python Daily

Django admin in Nextjs

https://redd.it/1lbmqzz
@pythondaily

Читать полностью…

Python Daily

NameError Issue with Flask

I'm trying to make a battle simulator with flask, and I've encountered a really weird issue. The initial index.html renders fine, but when I click on a button that links to another page (that has proper html), i get this NameError: logging is not defined.

My program doesn't use logging, has never used logging, and it doesn't get resolved even after I imported it. My program worked fine, but after I tried downloading an old logging module that subsequently failed (in Thonny if that's important) I've been unable to fix this issue. I've cleared my pycache, I've checked if anything was actually/partially installed. I even tried duplicating everything to a new directory and the issue persisted.

When I replaced my code with a similar project I found online, it worked completely fine, so my code is the issue (same modules imported, same dependencies, etc). However, as I've said, my code worked well before and didn't directly use anything from logging

https://docs.google.com/document/d/1zRAJHpZ1GAntbbYB2MsRDKLeZWplHKIzMJ6h2ggMzuU/edit?usp=sharing (Link to all the code)

Working index.html

When I click on \\"Start Battle!\\" This shows up \(If this is too blurry, the link above has the error text as well\)

The code that is shown in the traceback seems to be weirdly arbitrary. I don't

/r/flask
https://redd.it/1lb967q

Читать полностью…

Python Daily

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

Читать полностью…

Python Daily

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

Читать полностью…

Python Daily

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

Читать полностью…

Python Daily

Google Veo 3 Implemented from Scratch

# What My Project Does

I try to replicate the Google Veo 3 training process from data preprocessing to inferencing by reading their tech report and model card. It's an step by step implementation of understanding the code along with the theory of what the code is doing.

# Target audience

This project is for students and researchers, who want to understand how veo 3 latent diffusion method works that can generate (videos+audios) from text prompt or images.

# Comparison

I implemented this in a notebook so that we can see what what happens on each step so we can easily understand the code and can change accordingly. It's a learning project.

# GitHub

Code, documentation, and example can all be found on GitHub: https://github.com/FareedKhan-dev/google-veo3-from-scratch

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

Читать полностью…

Python Daily

simple blog in django

This is my first django project, I know it is very basic but I just want to share it with you guys and want to know your feedback.

https://preview.redd.it/q1pkv92fs87f1.png?width=1366&amp;format=png&amp;auto=webp&amp;s=e79ba5c2e1397af29b5068f9aef3b993c4bed0a8

https://preview.redd.it/os8hcutis87f1.png?width=1366&amp;format=png&amp;auto=webp&amp;s=c6ba6fa7912f891b53f4497da001f73c4837d456

https://preview.redd.it/17l9mmils87f1.png?width=1366&amp;format=png&amp;auto=webp&amp;s=3dccd6b59f7c197bc621804475505534e9392000

https://preview.redd.it/hmm5jy7ns87f1.png?width=1366&amp;format=png&amp;auto=webp&amp;s=7ea1ab8908fc53d37f176f57b0bb8d5bd55598f1

https://preview.redd.it/6uvcpjaos87f1.png?width=1366&amp;format=png&amp;auto=webp&amp;s=10762114de2f8cb71e4ed01021c16d390d02e618




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

Читать полностью…

Python Daily

Built open-source portfolio website with Python , Django , Tailwind CSS, & Alphin.js

I wanted to share my personal portfolio website I've been working on recently. It's built using Django (Python backend), Tailwind CSS (styling), and Alpine.js (lightweight interactivity). The site is open source, and all content (hero section, about me, tech stacks, experience, projects, blog posts, etc.) is customizable through the Django admin.

**GitHub** : [https://github.com/gurmessa/my-portfolio/](https://github.com/gurmessa/my-portfolio/)

**Link**: [https://gurmessa.dev/](https://gurmessa.dev/)

**Features**

* **Blog system** with CKEditor (rich text editor with code formatting support)
* Manage **Projects**, **Work Experiences**, and **About Me** sections
* **Custom Django admin** interface using `django-unfold`
* **Singleton model** (`PortfolioProfile`) to manage site-wide portfolio info
* **Image thumbnails** generated using `sorl-thumbnail`
* **Tests** for all views and models included
* **Factory Boy** used to generate test data
* **Meta tags** added for SEO on selected pages
* **Environment-specific settings** for production and local development
* **Context processor** to pass `PortfolioProfile` instance to all templates automatically
* **Filter views** with `django-filter` for flexible querying
* **Alpine.js** used for frontend interactivity like carousel & tabs
* **Docker & Docker Compose** for production-ready deployment
* **Continuous Integration (CI)**: Automated tests run on every pull request via GitHub Actions
* **Continuous Deployment (CD)**: auto-deploys to production via GitHub Actions with every push to `main`

I’d love your feedback

Thanks!

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

Читать полностью…

Python Daily

Question about reusing/sharing apps

Hello everyone,

I'm currently starting a new project and have a question about sharing apps between separate projects.
I'm building something that will need two different servers that have different purposes and deployments, but still will need to interact largely with the same data, so to avoid repeating myself and also inevitably making mistakes in maintaining the same thing twice, I wanted to have all those things in apps that are shared between those two projects.
As they are generally closely tied together, I want to develop this in a monorepo type structure for now. My structure right now looks something like this:

backend
- server1
- server2
- sharedapp1
- shared
app2
- ...

Each of the servers has its own venv managed by uv.

Now, I am unsure on how the proper way is to import an app here. I found two ways that generally work:

1: Package them as a pip package with a setup.py and install them to the individual servers

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

Читать полностью…

Python Daily

Monday Daily Thread: Project ideas!

# Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

## How it Works:

1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.

## Guidelines:

* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.

# Example Submissions:

## Project Idea: Chatbot

**Difficulty**: Intermediate

**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar

**Description**: Create a chatbot that can answer FAQs for a website.

**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)

# Project Idea: Weather Dashboard

**Difficulty**: Beginner

**Tech Stack**: HTML, CSS, JavaScript, API

**Description**: Build a dashboard that displays real-time weather information using a weather API.

**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)

## Project Idea: File Organizer

**Difficulty**: Beginner

**Tech Stack**: Python, File I/O

**Description**: Create a script that organizes files in a directory into sub-folders based on file type.

**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)

Let's help each other grow. Happy

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

Читать полностью…

Python Daily

The GIL is actually going away — Have you tried a no-GIL Python?

I know this topic is too old and was discussed for years. But now it looks like things are really changing, thanks to the PEP 703. Python 3.13 has an experimental no-GIL build.

As a Python enthusiast, I digged into this topic this weekend (though no-GIL Python is not ready for production) and wrote a summary of how Python struggled with GIL from the past, current to the future:
🔗 Python Is Removing the GIL Gradually

And I also setup the no-GIL Python on my Mac to test multithreading programs, it really worked.

Let’s discuss GIL, again — cause this feels like one of the biggest shifts in Python’s history.

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

Читать полностью…

Python Daily

I'm a front-end developer (HTML/CSS), and for a client, I need to build a GUI using Python.

Hi everyone!

I'm a front-end developer (HTML/CSS), and for a client, I need to build a GUI using Python.

I've looked into a few options, and PyWebView caught my eye because it would let me stay within my comfort zone (HTML/CSS/JS) and avoid diving deep into a full Python GUI framework like PySide or Tkinter.

The application will be compiled (probably with PyInstaller or similar) and will run locally on the client's computer, with no connection to any external server.

My main concern is about PyWebView’s security in this context:

Are there any risks with using this kind of tech locally (e.g., unwanted code execution, insecure file access, etc.)?
Is PyWebView a reasonable and safe choice for an app that will be distributed to end users?

I'd really appreciate any feedback or best practices from those who've worked with this stack!

Thanks in advance

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

Читать полностью…

Python Daily

🏠 I built a Django Real Estate website years ago with just basic features. Look what it became! [SHOWCASE]

Hey r/Django! 👋

I wanted to share something I'm pretty excited about. A few years back, I started working on a simple real estate website using Django. Back then, it was just basic stuff - you know, show some properties, maybe a contact form, nothing fancy.But over time, I kept adding more features whenever I learned something new or had a cool idea. Now it's turned into this pretty comprehensive real estate platform!

What started as:

* Basic property listings
* Simple contact forms
* User registration/login


Screenshots:

[Home page](https://preview.redd.it/ujipexhh837f1.png?width=1850&amp;format=png&amp;auto=webp&amp;s=6354b35eac4af100067499403a21c67418fb4d18)

[Project details](https://preview.redd.it/8ngylybk837f1.png?width=1850&amp;format=png&amp;auto=webp&amp;s=15996b9c5880b00684a1e7e68a26dabeca731551)

[Login](https://preview.redd.it/5w2lh4a4937f1.png?width=1850&amp;format=png&amp;auto=webp&amp;s=6fbb688164b3bfe6a0cc75633b475c5f7ac413e3)

https://preview.redd.it/vwwshyy5937f1.png?width=1850&amp;format=png&amp;auto=webp&amp;s=d6188fbae0c292195440b9df005cdaf56dc15800



Has grown into:

* Advanced search with fancy tabs (Projects, For Rent, For Sale)
* User wishlist system (you can save properties!)
* Real estate project management (for new developments)
* Admin dashboard for managing everything
* Property inquiry system
* User profiles and dashboards
* Photo galleries with lightbox
* Responsive design that works on mobile
* Tech stack:
* Django 5.2.3
* Bootstrap for UI
* JavaScript for interactive stuff
* SQLite (but can use PostgreSQL)

Cool features I'm proud of:

* The search interface looks modern with glass effects
* Progress bars showing project completion status
* AJAX wishlist functionality
* Comprehensive admin panel
* Generated sample data with Faker for testing

It's been a fun journey watching this project grow from a simple idea to something that actually looks professional. The code is on GitHub if anyone wants to check it out: [https://github.com/manjurulhoque/django-real-state](https://github.com/manjurulhoque/django-real-state) **added tons of screenshots** in the README

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

Читать полностью…

Python Daily

Open Source Unsiloed AI Chunker (EF2024)

Hey , Unsiloed CTO here!

Unsiloed AI (EF 2024) is backed by Transpose Platform & EF and is currently being used by teams at Fortune 100 companies and multiple Series E+ startups for ingesting multimodal data in the form of PDFs, Excel, PPTs, etc. And, we have now finally open sourced some of the capabilities. Do give it a try!

Also, we are inviting cracked developers to come and contribute to bounties of upto 1000$ on algora. This would be a great way to get noticed for the job openings at Unsiloed.

Bounty Link- https://algora.io/bounties

Github Link - https://github.com/Unsiloed-AI/Unsiloed-chunker



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

Читать полностью…

Python Daily

Learning Backend for the first time with Flask but hate styling the frontend

Hey is it okay to use AI for developing the frontend for my flask app projects? I hate CSS and know only Python and not JS. I tried but I just hate to take css up from a blank page. I hate styling even with Bootstrap. It is not that I don't want my projects or website to look good, the thing is only that I don't like writing or learning the code to design pages.
So if I am making those projects for my portfolio as a backend developer, is it okay to use AI for the frontend?

/r/flask
https://redd.it/1larrwz

Читать полностью…

Python Daily

Best Resources to Learn Django ?

I already have experience with Flask and have built a couple of small projects using it. Now I'm planning to dive into Django and would love to hear from the community

What are the best resources (courses, tutorials, YouTube channels, books) for learning Django ?

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

Читать полностью…

Python Daily

how django handles multiple users at the same time

Hey guys, in my almost completed inventory management app i have two types of users (admin and operator), and it is possible and will likely happen, that, once i deploy the app both users will use it at the same time.

an example:
imagine an admin is adding a specific quantity of stock to a product or a new product (functionalities that are specific to this user type) and the operator is removing stock of the same or other product, how is django going to deal with this?

thanks in advance

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

Читать полностью…
Subscribe to a channel