Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
Startup
Hello. I’m building a web app using Django to offer telehealth services in my country. Any tips that could help will be greatly appreciated.
In the meantime, I’m hoping to get help with the FrontEnd since I’ve only learnt backend with a little css and JavaScript.
/r/django
https://redd.it/1isnz2w
Efficient Python Programming: A Guide to Threads and Multiprocessing
🚀 Want to speed up your Python code? This video dives into threads vs. multiprocessing, explaining when to use each for maximum efficiency. Learn how to handle CPU-bound and I/O-bound tasks, avoid common pitfalls like the GIL, and boost performance with parallelism. Whether you're optimizing scripts or building scalable apps, this guide has you covered!
🔗 Watch here: https://www.youtube.com/watch?v=BfwQs1sEW7I&t=485s
💬 Got questions or tips? Drop them in the comments!
/r/Python
https://redd.it/1irl4ap
A drum machine and 16-step sequencer
# Background
I am posting a series of Python scripts that demonstrate using Supriya, a Python API for SuperCollider, in a dedicated subreddit. Supriya makes it possible to create synthesizers, sequencers, drum machines, and music, of course, using Python.
All demos are posted here: r/supriya\_python.
The code for all demos can be found in this GitHub repo.
These demos assume knowledge of the Python programming language. They do not teach how to program in Python. Therefore, an intermediate level of experience with Python is required.
# The demo
In the latest demo, I show how to create a drum machine with a 16-step sequencer. Much of the post is dedicated to discussing the various design-related decisions that must be made when creating a step sequencer. Please give the demo script a try and let me know what you think.
/r/Python
https://redd.it/1iscyp4
I created a Python Price Tracker
The link of the project is here.
What My Project Does
It automatically reads the price from certain shop links and returns the price to the user, notifying them of price changes automatically.
I am currently trying to buy a pc ($500 pc but still) and since I am saving and I am scared that the prices will be constantly changing I created a program that automatically updates an excel and sends me a message, through the telegram API of possible price changes.
It has the following features:
\- Five minute check of all products and prices.
\- Automatic message sending, along with easy to follow instructions to configure the telegram bot.
\- Automatic updating of the excel sheet
The only downside is that since I am web scraping some stores are still not available in the price_getter file.
It is just a side project but if anyone wants me to add a store to retrieve the prices from there I will keep on updating it for a while!
Target Audience
For this project I think people saving up for items in certain shops could use this project to track their price in real time.
The code uses webscraping, Telegram API, and google sheets API
You could just implement it as a module in
/r/Python
https://redd.it/1irye5t
Video game review site
Hey so I am learning flask and starting to do a project which is kinda like a video game review site, which involves sql where the user can provide reviews and stuff, are there any open source codes that I can use as a guideline for my project?
/r/flask
https://redd.it/1is8mxc
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/1iryz2j
Deploying flask app with waitress and NSSM
I'm deploying a small internal Flask app for my organization, and I must run it on Windows due to a third-party dependency. Right now, I'm using Waitress as the WSGI server and NSSM to run it as a service.
Since this is for internal use only (private network, not exposed to the internet), do I really need a reverse proxy like Nginx or IIS? I know it's generally recommended for public-facing apps, but for an internal tool, are there any real downsides to just using Waitress directly?
/r/flask
https://redd.it/1irqa4j
How to do customer-defined fields in different deployments without managing multiple models across them?
I'm looking at a project where the business data collected and stored will be different per customer deployment, and will change within the customer's deployment lifecycle.
I've never done this with structured databases before, only with nosql solutions, and then not with Django as my framework.
An oversimplified example of this is one deployment might want to store first name, last name and date of birth, and a different deployment might want to store last name, domicile and passport number. So there's potentially very few common fields between deployments.
Are there any good out-of-the-box solutions for this kind of approach with Django?
/r/django
https://redd.it/1irhjh9
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/1ir6gzu
Cloudinary Upload Issue on PythonAnywhere: MaxRetryError
Hello everyone,
I'm developing a Django application that uses Cloudinary for image storage. When running the project locally, everything works fine, and images upload successfully.
However, when I deploy the project on PythonAnywhere, I get the following error when trying to upload an image from the admin panel:
https://preview.redd.it/4uu7mysdmlje1.png?width=1846&format=png&auto=webp&s=2a37fb91aa8e70527be9658581f14b47822b8e4f
Configuration in settings.py
:
https://preview.redd.it/scavz51hmlje1.png?width=835&format=png&auto=webp&s=41e350b3870f11b91426d978de283ce59f5478af
# Things I've already checked:
The credentials (`CLOUD_NAME`, `API_KEY`, `API_SECRET`) are correctly set.
In my local environment, images upload successfully to Cloudinary.
In PythonAnywhere, the connection is refused.
I tried removing the 'API_PROXY'
setting, but the error persists.
#
Do I need to configure anything extra to allow the connection?
I’d really appreciate any suggestions or solutions. Thanks in advance!
/r/django
https://redd.it/1ir7rwp
Search a Developer to build project in hackathon
hello I search for a web developer have a experience in frontend or backend in django, and have age under 19 years old, we need him in hackathon if he want to work in team send me in private
/r/django
https://redd.it/1ir4yfa
21 Projects to Master Flask - Let's learn together 🌟
Hey Flask enthusiasts! 👋
Whether you're just starting out with Flask or looking to deepen your skills, I've put together a comprehensive list of 21 projects that will take you from beginner to advanced Flask developer. I have personally curated this list and am currently following it myself.
# Why Projects?
I believe learning by doing is the best way to internalize concepts, and Flask is no exception. By working through these projects, I am gradually gaining hands-on experience with Flask's core features, as well as advanced topics like authentication, caching, WebSocket communication, and deployment.
# The 21 Projects
# Week 1: Basic Flask Web Development
1. Hello Routes Flask App : Your first Flask app with simple routes.
2. Personal Portfolio Website : Build a multi-page static site with Jinja2 templates.
3. Weather App : Fetch and display weather data using an external API.
4. To-Do List App : Create a basic task manager (no database yet).
5. Blogging Platform (Basic) : A simple blog where users can create and view posts (SQLite for storage).
6. User Authentication System : Implement user registration, login, and protected routes.
7. File Upload Service : Allow users to upload files and display them.
# Week 2: Intermediate Flask & API Development
1. RESTful API for
/r/flask
https://redd.it/1iprq9e
Where do you store reusable code snippets?
Hey folks! Curios where do you store your code snippets? If you work in a team how do you manage it?
/r/django
https://redd.it/1iqwb7j
Arkalos - Modern Python Framework for AI & Data Artisans
I've open-sourced my latest side project and it was the first time I was building a framework from scratch in Python. I do have a lot of experience in other languages and systems though.
# Comparison
Using Python over many years mostly for data analysis and now with the global AI, agents, RAG trend, I always struggled with basic stuff like just setting up a new Python project.
It could be a bunch of organized Jupyter notebooks that later grow into a more complex structure. And even for cluster analysis, I had to import 10+ modules and write so much code, when it could be just one line.
Over the past months I needed a simple local data warehouse and AI agent to talk to it, and fine-tune a model and do anything locally for privacy reasons. And I couldn't get it done easily. Had to try different tools, read bad documentation and still had to write code that doesn't look beautiful and natural.
So, I just scratched my own itch.
Introducing Arkalos - an easy-to-use modern Python framework for data analysis, building data apps, warehouses, AI agents, robots, ML, training LLMs with elegant syntax. It just works.
# What My Project Does
* 🚀 **Modern Python Workflo**w:
/r/Python
https://redd.it/1iqumjr
HELP: django.core.exceptions.SuspiciousFileOperation: Detected path traversal attempt
In a nutshell, I'm trying to convert user-uploaded images in the admin page to .webp format and then re-save it, overwriting the non-webp image file in the specific DB row. This is done by passing the execution off to Celery/Rabbitmq after the admin hits save. I have the code working to convert the image, and I can see the new webp image in the MEDIA\_ROOT dir, but when it comes time to save the new image back into the DB and overwrite the current non-webp image, I'm getting a path traversal error. Here is my model's save method I am overwriting:
def save(self, *args, **kwargs):
image_fields = {
'main_product_img': self.main_product_img,
'product_img_2': self.product_img_2,
'product_img_3': self.product_img_3,
/r/django
https://redd.it/1iqdi46
Django + Caddy in Docker Compose?
Does anyone have an example of a production ready docker compose for django with caddy as a reverse proxy ? an example of a compose file and a caddyfile would be so helpful :D
/r/django
https://redd.it/1isexe4
Greenlets in a post GIL world
I've been following the release of the optional disable GIL feature of Python 3.13 and wonder if it'll make any sense to use plain Python threads for CPU bound tasks?
I have a flask app on gunicorn with 1 CPU intensive task that sometimes squeezes out I/O traffic from the application. I used a greenlet for the CPU task but even so, adding yields all over the place complicated the code and still created holes where the greenlet simply didn't let go of the silicon.
I finally just launched a multiprocess for the task and while everyone is happy I had to make some architectural changes in the application to make data churned out in the CPU intensive process available to the base flask app.
So if I can instead turn off yet GIL and launch this CPU task as a thread will it work better than a greenlet that might not yield under certain load patterns?
/r/Python
https://redd.it/1is6amk
We built a blockchain that lets you write smart contracts in NATIVE Python.
# What My Project Does
Hey everyone! We’ve been working on **Xian**, a blockchain where **you can write smart contracts natively in Python** instead of Solidity or Rust. This means Python developers can build decentralized applications (dApps) without learning new languages or dealing with complex virtual machines. I just wrote a post showing [how to write and test a smart contract in Python](https://in.mt/how-to-write-and-test-a-smart-contract-in-python-on-the-xian-blockchain) on Xian. If you’ve ever been curious about blockchain but didn’t want to dive into Solidity, this might be for you.
# Target Audiences
* Python developers interested in Web3 or blockchain but don’t want to learn Solidity.
* People curious about how blockchain works under the hood.
* Developers looking for **an easier way to write smart contracts** without switching to a new language.
# Comparison (How It’s Different)
* **Solidity/Rust vs Python:** Unlike Ethereum, where you must write contracts in Solidity, Xian lets you write them in **pure Python** and deploy them **without extra conversion layers**.
* **Faster Prototyping:** Since Python is widely used, Xian makes it easier to prototype and deploy blockchain applications.
* **Simpler Developer Experience:** No need for specialized compilers or bytecode conversion—just **write Python, deploy, and execute**.
# Links
* **Guide:** [How to Write and Test a Smart Contract
/r/Python
https://redd.it/1iscge8
Fiask App with ultralytics
Hi, what hardware would i need for it to handle flask App, it would use 5 ultralytics yolo models, and I need for this hardwate to handle about 30-40 users
/r/flask
https://redd.it/1isadea
How can I use session data to track what registration pages were filled out?
Hello, I wanted to use session data to keep track of what pages were filled out in the registration sequence and which ones were not. Just in case the user leaves the page, and comes back, I want them to be able to log back in and start where they left off in the process. These are all html pages containing text fields. I have tried alot of different things but it always starts me back on the beginning page regardless of where I left off.
/r/django
https://redd.it/1is4hjw
I accidentally made an LMS... Now it's open-source 🤷♂️
So, I was just trying to learn Django, and somehow ended up building a full-blown Learning Management System adilmohak/django-lms. You know, as one does.
It's got all the usual stuff – courses, quizzes, student management, and even a dashboard because who doesn't love looking at colorful graphs pretending to be productive?
Anyway, it's open-source now because I figured someone out there might need it (or at least want to poke fun at my code). If you're curious, feel free to check it out or roast me in the comments.
Oh, and I moved it from my personal account to its own organizational account... thought it might make life easier for contributors.
/r/django
https://redd.it/1irq2dz
Announcing JupyterCAD 3.0
https://blog.jupyter.org/announcing-jupytercad-3-0-d8f4b7b0a719
/r/IPython
https://redd.it/1irknuy
TerminalTextEffects (TTE) version 0.12.0
I saw the word 'effects', just give me GIFs
Understandable, visit the Effects Showroom first. Then come back if you like what you see.
What My Project Does
TerminalTextEffects (TTE) is a terminal visual effects engine. TTE can be installed as a system application to produce effects in your terminal, or as a Python library to enable effects within your Python scripts/applications. TTE includes a growing library of built-in effects which showcase the engine's features.
Audience
TTE is a terminal toy (and now a Python library) that anybody can use to add visual flair to their terminal or projects. It works best in Linux but is functional in the new Windows Terminal.
Comparison
I don't know of anything quite like this.
Version 0.12.0
It's been almost nine months since I shared this project here. Since then there have been two significant updates. The first added the Matrix effect as well as canvas anchoring and text anchoring. More information is available in the release write-up here:
0.11.0 - Enter the Matrix
and the latest release features a few new effects, color sequence parsing and support for background colors. The write-up is available here:
0.12.0 - Color Parsing
Here's the repo: https://github.com/ChrisBuilds/terminaltexteffects
Check it out if you're interested. I appreciate new ideas and feedback.
/r/Python
https://redd.it/1ir9xk7
Running Celery, Flask, and NGINX on AWS ECS using Docker
The YouTube playlist is broken into seven parts:
1. An introduction to celery
, celery_beat
, celery_flower
, nginx
, and the AWS components that will be used
2. Overview of the app files and config files that can be referenced back to if needed in subsequent videos
3. Get the app **just working** on AWS. We'll rely on a lot of the defaults provided by AWS (networking and environment variable storage) to get a working example that you can see in action quickly deployed on AWS
4. We'll do the same as the previous video, but not rely on default networking setup by AWS and improve the security of the environment variable storage
5. Use GitHub Actions
to automate deployments (updates) to our app running on AWS ECS
6. Run a CDK (Cloud Development Kit) script that will create both the AWS networking components, as well as the ECS components. After running the script with a single `cdk deploy --all` command, the entire AWS architecture will be fully functional
This tutorial truly is end-to-end. You can support my work by:
sponsoring me on [Patreon](https://www.patreon.com/programmingwithalex) or [GitHub Sponsors](https://github.com/sponsors/programmingwithalex)
subscribing to my YouTube channel
liking and/or commenting on the videos
sharing the video(s) or channel on any platform (Reddit, Twitter (or X
/r/flask
https://redd.it/1irbifc
Send and Receive RCS Messages...help?
I want to create a tool that allows me to communicate with my database via RCS messaging. Is there a way to do this with Django? I found some options online but it seemed like they were paid apis. I'm wondering what it takes to implement my own API that can handle RCS messaging.
/r/django
https://redd.it/1ir8lrw
PaaS host with best developer experience and reasonable pricing?
Hey all, I'm starting to evaluate PaaS providers for a django/postgres app for the MVP of a startup. I'll be a single developer working on this for now
I've started experimenting with Railway for a few days now and I'm unsure how easy it will be to work with long-term. I'm not sure if the node based architecture designer will be annoying or not. The documentation seems like it could be lacking/outdated. The pricing model isn't clear about how much it will cost monthly once we start to see a bit of usage.
I've considered Fly.io, Digital Ocean App Platform, and Heroku. I don't want to use a VPS because I want to spend as little time as possible managing the server so I can focus on building the application.
Main needs are easy deployment, visibility into any issues when it comes to debugging, and a price point of less than $80/month for 2 app servers & 2 database servers
No need for HIPAA/SOC 2/etc compliance/certifications.
Does anybody have medium to long term experience working with any of the services mentioned or any others you'd recommend?
Thanks!
/r/django
https://redd.it/1ir3wfd
Looking for a famous video about Python
There’s this well-known video about the "Pythonic way." In it, a famous python expert gives a speach on conference. He shares how he was hired by a large company to revise a Python wrapper built on top of Java libraries. At one point, he shows a sample of code to the audience and asks if they think it’s Python code. They all agree that it is, but then he reveals that it’s actually Java code. And yes that python is ugly and just look like java. He then goes on to explain how he transforms it into a more Pythonic approach, adding methods for with
and for
, among other changes. And he completely transform code so it's python.
This video is a great language agnostic example,, and I need it for a presentation where I plan to convince people that a some go project is essentially just Java Spring, but rewritten in Go. If anyone knows this video, please share it!
/r/Python
https://redd.it/1iqvcec
doubts about storing and using environment variables
I'm really too confused. I'm trying to securely save some environment variables like the SECRET_KEY so I can later deploy my flask app to pythonanywhere. I found some guides that say to use .gitignore to allow ignoring some files when cloning the github repository. Isn't that wrong? I mean, how does the app, when launched, assign the SECRET_KEY variable with os.getenv from the .env if this file is not present in the project I have deployed in pythoanywhere? I think I understood badly, actually English is not my first language so I have difficulty understanding everything well.
/r/flask
https://redd.it/1iqpf5v
RedCoffee: A Personal PyPi Project That Crossed 6K+ Downloads
Hi everyone,
I hope you are doing well.
I just wanted to take a moment to say thank you to everyone in this community. When I first built [RedCoffee](https://pypi.org/project/redcoffee/), it was just a hobby project—something that solved a personal need. I never imagined it would cross 6,000 downloads or that so many of you would find it useful. Seeing the response, the feedback, and the feature requests has been incredibly motivating, and I truly appreciate all the support.
# What my project does ?
Just a quick recap - RedCoffee is a CLI tool that generates PDF reports from SonarQube Community Edition’s code analysis, which lacks a native PDF export feature. While some GitHub projects addressed this need, they are no longer actively maintained. This was my pain point while working with my fellow developers and hence I built this solution.
With that, I’ve just pushed v1.8, which includes a few important fixes:
* Fixed: Duplication % was always showing as 0—this has now been corrected.
* Resolved: The last issue from the API response wasn’t appearing—this is now fixed.
* UI Tweaks: Minor improvements to the PDF formatting.
# Lessons Learned & What’s Next
While building this, I made some classic mistakes—ones that I often advise others to
/r/Python
https://redd.it/1iqsb0k
D Self-Promotion Thread
Please post your personal projects, startups, product placements, collaboration needs, blogs etc.
Please mention the payment and pricing requirements for products and services.
Please do not post link shorteners, link aggregator websites , or auto-subscribe links.
--
Any abuse of trust will lead to bans.
Encourage others who create new posts for questions to post here instead!
Thread will stay alive until next one so keep posting after the date in the title.
--
Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.
/r/MachineLearning
https://redd.it/1iqiy4x