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
Is there a reason for needing to import so many libraries?

Me and a friend are working on a school project for which we **have to** use flask for the backend. I realised that we needed to import a metric fuckton of libraries for buttons, forms and that type of stuff.


Is there a reason for that?

/r/flask
https://redd.it/1lbaaqw
Local LLM Memorization – A fully local memory system for long-term recall and visualization

Hey r/Python!

I've been working on my first project called LLM Memorization — a fully local memory system for your LLMs, designed to work with tools like LM Studio, Ollama, or Transformer Lab.

The idea is simple: If you're running a local LLM, why not give it a memory?

# What My Project Does

Logs all your LLM chats into a local SQLite database
Extracts key information from each exchange (questions, answers, keywords, timestamps, models…)
Syncs automatically with LM Studio (or other local UIs with minor tweaks)
Removes duplicates and performs idea extraction to keep the database clean and useful
Retrieves similar past conversations when you ask a new question
Summarizes the relevant memory using a local T5-style model and injects it into your prompt
Visualizes the input question, the enhanced prompt, and the memory base
Runs as a lightweight Python CLI, designed for fast local use and easy customization

# Why does this matter?

Most local LLM setups forget everything between sessions.

That’s fine for quick Q&A — but what if you’re working on a long-term project, or want your model to remember what matters?

With LLM Memorization, your memory stays on your machine.

No cloud. No API calls. No privacy concerns. Just a growing personal knowledge

/r/Python
https://redd.it/1lb9fcr
Building an ERP: ready-made platforms vs custom development

I’m a software engineer, and a client has asked me to deliver a fast B2B solution. I’d never heard of Odoo before and I’m curious whether it could really save me time on the infrastructure side. I’m looking for a platform I can customize with my own code and integrations, and so far I’ve shortlisted ERPNext, Odoo, and Axelor as ready-made options.

Long story short, I’m building a portal where electronics suppliers can log in and upload products to the company for which I’m developing the ERP; that company will then resell those items to smaller retailers at a steep discount. Major chains such as Micro Center, Electronic Express, and Abt Electronics will need access as well. The company essentially acts as an intermediary, handling all purchase requests, shipment tracking, and invoicing.

My question: Is it really better to leverage one of these ready-made frameworks, or would building the system from scratch give me a more solid and scalable solution?

/r/Python
https://redd.it/1lb5jk5
Why is Django not the most popular framework?

Python is the most popular programming language with AI/ML becoming centerstage. Then why is Django not the most popular web framework? It seems natural that when models are hosted via API and need a web interface for users, then the Python developers who built the model would opt for Django since it is also in Python.

But I don't see as active an involvement on YouTube for Django compared to Next.js, React, and other Frontend frameworks. Am I misinterpreting it or missing something in my understanding?

I also realised that it's not straightforward to integrate frontend technologies such as Tailwind CSS as it is for other frontend frameworks.

Django has strong security and a fully developed Admin interface which saves lot of development time but still I see that it's not as popular as other frameworks such as Laravel or Next.js.

I am at a point where I need to pick a framework as a goto framework for all my future web development and I am at the moment torn between options and indecisiveness.

I foresee having AI components in my apps and needing to interact with trained models at some point. And I am reluctant if I pick Django,

/r/django
https://redd.it/1lba2to
My First Project With Python FeedBacks

Hii, i started to student python for 8 moths ago and I finally end my first project, I created a simple crud and would like opinions about my code.



Any feedback for me is very important



github: https://github.com/Kelabr/profindustry

/r/Python
https://redd.it/1lbi5uc
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
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
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
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
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
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
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
🏠 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&format=png&auto=webp&s=6354b35eac4af100067499403a21c67418fb4d18)

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

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

https://preview.redd.it/vwwshyy5937f1.png?width=1850&format=png&auto=webp&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
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
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
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
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