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
How bad does logging impact performance?

I run django channels in my application with heavy server-client communication and every message from a client triggers a log. Is that too bad?

/r/django
https://redd.it/1iq7703
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/1iqf81z
Drf vs Django ninja for new enterprise project?

Going to be working on a migration away from a legacy platform. I’ve decided on Django + react - but I’m not sure on the current landscape when it comes to Django ninja vs drf and which I should start the project with. Would love to hear thoughts or input on which to go with for a successful business moving away from a legacy php stack.

/r/django
https://redd.it/1iqnpgy
For those who are good at cython, how did you learn it?

I found that cython docs is not the best and missing many information.
I also tried to search google but only found little results.

/r/Python
https://redd.it/1iqpkab
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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