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
Electric Vehicles Problems

i wanted to work on web app or SAAS product that is about Electric Vehicles. What kind of problems people are facing frequently. so, that i can put them in my application. can anyone help me out?

/r/djangolearning
https://redd.it/1hsgroa
py2exe.com - flask app to convert python files to exe online

Hi,

I made a website (https://py2exe.com/) that compiles python to exe in the cloud. It could be useful for someone that wants to make .exe from python on linux, which is quite difficult to do.

The website is written in flask and the compilation is done via pyinstaller through wine. I would really appreciate it if someone could try it out with their project and share their thoughts.

The code is available on github (https://github.com/cenekp74/py2exe). I would love to hear your thoughts on my implementation of celery task queue or any other part of the flask app since I am not an expert and would love to improve.

Thanks!

/r/flask
https://redd.it/1hvcm8o
WhiteNoise with Nginx for Django

I'm working on deploying a Django application, and I'm trying to figure out the best way to handle static files. Right now, I'm using WhiteNoise to serve static files.

My plan is to use Nginx as a reverse proxy for the Django app (running on Gunicorn) and also to serve static files. However, I'm not entirely sure how to configure Nginx to work alongside WhiteNoise.

1. Should I disable WhiteNoise entirely in production and let Nginx handle all static files?
2. If I keep WhiteNoise enabled, how should the Nginx configuration look?
3. Are there any pros/cons to using both together, or should I stick with one solution?

/r/django
https://redd.it/1hvi8io
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/1hvdxdo
How does the search algorithm work?

I am creating a web application in which registered users will have the opportunity to use a storage in which to store all their mp3 and wav files.
When they memorize them obviously they can listen to them and download them.
I created the user's song search system, so that he can individually select those that interest him more easily. The problem is that my system is very ugly: I take the user's input and check if the string he typed is inside the real_name column (of the file, file names stored in directories are changed to werkzeug.secure_filename) in the database and returns it.
Example: the user writes "I love" and if he presses enter the site returns "I love you.mp3", "I love him.wav", etc.
The problem is that a few small variations are enough to not give anything back.
Example: The user writes "I lo v," and the site returns nothing.
Is there an efficient algorithm?

/r/flask
https://redd.it/1hvob4c
Need suggestions on a flask-based cashflow management app with LLM

Hey r/flask folks! About a few months ago I shared my cash flow tracking project post , a modern cash flow management system that leverages AI for financial insights. And got some amazing feedback from you all. I've been coding like crazy since then and wanted to get improvement feedback!

Github repo

πŸ› οΈ Tech Stack

Backend: Flask + SQLAlchemy
Frontend: Vanilla JS + Chart.js
Database: SQLite (will use PostgreSQL or MySQL on prod)
AI: Anthropic's Claude 3 Sonnet
Authentication: Flask-Login
Forms: Flask-WTF
Migration: Flask-Migrate
Data Processing: Pandas + NumPy
Visualization: Chart.js + Matplotlib
File Handling: OpenPyXL

πŸ—οΈ Architecture

https://preview.redd.it/xaedzaklnhbe1.png?width=1120&format=png&auto=webp&s=8173570a7c7271cb2bb251eb9ffa727d2fc12fae

πŸ’‘ Key Features

Smart Analysis: AI-powered insights into cash flow patterns Real-time Monitoring: Live tracking of financial metrics Data Visualization: Interactive charts and graphs Bulk Operations: Efficient data import/export Multi-user Support: Secure user isolation and preferences

πŸ”œ Coming Soon

Custom date range analysis API integrations Advanced reporting Team collaboration features Mobile app

Would love to hear your thoughts and suggestions! Feel free to contribute or raise issues on GitHub.

/r/flask
https://redd.it/1hvhx8g
Tiny Python library that turns functions into GUI apps


Hey! I made a small tool that lets you create GUI applications just by writing normal Python functions. It's inspired by FastAPI-Typer, but for desktop-mobile GUIs.

# Basic example:

from functogui import App, intUi, boolReturn

def iseven(number: int = intUi(4)) -> boolReturn:
    return number % 2 == 0

App(is
even)

That's it - it creates a complete GUI with a slider and shows the result in real-time. Useful for quick tools and prototypes when you don't want to mess with UI code.

Built with Kivy, supports file handling, image preview, and different input types. Would love to hear your thoughts or suggestions!

Github Repo

/r/Python
https://redd.it/1hve7v7
Developing locally after deployment? (Oauth issues)

I built my flask app and just deployed it on python anywhere. I updated my oauth credentials to point to the real site rather than localhost.

My login functionality no longer works locally (I'm only supporting Google login, no passwords/email).

How do others get around this? Perhaps have something set in the code so if app is running in debug mode the user skips login?

/r/flask
https://redd.it/1hvppmk
Open sourcing our python browser SDK that allows you use LLMs to automate tasks on any website

# Use Dendrite to build AI agents / workflows that can:

* πŸ‘†πŸΌ Interact with elements
* πŸ’Ώ Extract structured data
* πŸ”“ Authenticate on websites
* ↕️ Download/upload files
* 🚫 Browse without getting blocked

Check it out here: [https://github.com/dendrite-systems/dendrite-python-sdk](https://github.com/dendrite-systems/dendrite-python-sdk)

/r/Python
https://redd.it/1hvs9hw
Built a Drag-and-Drop GUI Builder for CustomTkinter – Check It Out and Share Your Thoughts!

Hey Python devs!

I recently built a drag-and-drop GUI tool for customTkinter to simplify designing interfaces. It lets you visually create UIs and export the code directly, which has been super helpful for my projects.

I’d love to hear your thoughts and feedback on it! You can check it out on GitHub https://github.com/Proxlight/Buildfy-Free.git

I’m particularly interested in:
β€’ Usability: Is the drag-and-drop interface intuitive?
β€’ Features: What could make it even better?

Feel free to give it a try and let me know what you think. Any feedback would be amazing!

Thanks!

/r/Python
https://redd.it/1hvnyxn
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/1htw7hw
Asking about easy FRONTEND tools.

I have learnd django with REST Framework
Is it necessary to learn JS to build the front end or there is another easy tools.

I know thats important to learn JS, but I want a quick way to view my projects like other sites.


/r/djangolearning
https://redd.it/1hvq5tu
Vision, PDF reading and Python

Script to modify PDF file to make it read as you are looking at something at the distance.

https://github.com/ilevd/pdf-binocular

What My Project Does

Duplicate contents on every PDF page for binocular vision.

Target Audience

People that have eyes tension when reading books and want to try something to reduce tension.

Comparison

Probably it's similar to stereo/3d pictures.

/r/Python
https://redd.it/1hvy2ty
Where to host Flask App

Hi everyone! I just developed my first flask app, and needed some assistance in getting it deployed as I've never done it before. My app uses multiple databases (SQLite currently) to keep track of events and participation for an organization I am in. I originally was going to use render since it was free but since it seems like it refreshes it won't be a good fit since it will wipe my dbs. I then looked at creating a PostgreSQL database on render but their free tier only lasts a month. If there is a way to host this for free I'd love to do that since the org is only about \~100 people and the website wouldn't be in use constantly and the likelihood of concurrent writes is very low. I was wondering if anyone knew a place where I could host this web app (hopefully for free), or for low cost if I can use SQLite as I'd rather not update everything atp. If anyone has any advice or helpful resources I'd greatly appreciate it!

/r/flask
https://redd.it/1hvz0ov
Different values in group by columns before and after group by in pandas dataframe

I had following code:

sum_columns = ['p', 'q', 'r', 'Ax', 'Ay', 'Az']
avg_columns = ['Bx', 'By', 'Bz', 'G2 C03']
agg_map = {col: 'sum' for col in sum_columns}
agg_map.update({col: 'mean' for col in avg_columns})

df = df.groupby(['MAC C01', 'MAC C02', 'MAC C03'], as_index=False).agg(agg_map)

Dataframe before group by:

```
p q r Ax Ay Az Bx By Bz G2 C03 MAC C01 MAC C02 MAC C03
0 0.0 0.0 0.1 0 0 0 0 0 0 0.0 0.00000 0.00000 0.0
1 0.0 0.1 0.1 0 0 0 0 0 0 0.0 0.00000 0.00000 0.0
2

/r/Python
https://redd.it/1hw24sf
Logic in Views vs Logic on Models

Hey folks,

Apparently this is a frequently discussed topic.

Im doing a project using DRF. In this context i feel like the Views that are basically APIs should have logic, but my approach so far was that whatever touches a model, goes in the model.

Concrete example: one of my APIs has to change the Status of a Sales order. Then i will create a method in the SalesOrder model that will do the status change, along with any particular validation that it might want to do (example if you're changing it to completed/closed, ensure theres no open amount and the items were delivered)

Can you give me your thoughts about this approach and if its worth moving everything to either the views or to another "business logic" layer (or both)?

I dont really have crazy calculations or bigass logic for anything in particular, but i rather learn the proper way


Looking online i see all kinds of recommendations, the logic layer as well as the Thick Models, as well as "Model is simply the ORM". So i feel like it doesnt really matter as long as its consistent and is useful for the individual project?

/r/django
https://redd.it/1hw5066
Full-Stack Software Job at RegTech Startup

πŸš€ We’re Hiring: Full-Stack Software Developer πŸš€

RegMetrics is a regulatory compliance software for medical devices. Our mission is to simplify the regulatory journey, saving MedTech innovators and academics time and money while helping bring life-changing medical devices to market.

We’re looking for an experienced Python/Django developer with strong frontend skills to help us in our journey. If you know Wagtail, that's even better.

The job is fully remote but right now we can only hire from Brazil or UK.

If you're interested, please apply through our website

/r/django
https://redd.it/1hw2o2c
Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

/r/Python
https://redd.it/1hw61sj
Open-Source & Free Django App Generator - Select Design, Edit DB Tables, Extended User Fields, Add Celery, Social Login (GitHub), Docker

Hello guys!

[App-Generator.dev](https://App-Generator.dev) service released a simple Django App Generator that might help to customize, generate, and download the code as a ZIP archive or from GitHub.



[https://app-generator.dev/tools/django-generator/](https://app-generator.dev/tools/django-generator/)



The users can customize:

* UI: AdminLTE, Soft Dashboard .. etc (10 designs)
* DB Driver: SQLite (default), PgSQ, MySql/MariaDB
* DB Tables - table relations supported
* Extended User Model
* (optional) Social Login: GitHub
* (optional) Celery - async tasks
* (optional) Dynamic API - each model can be managed via a secured DRF endpoint
* (optional) Docker
* (optional) Ci/CD scrips for Render

The generator code uses a combination of template code generation and Astor Library for AST manipulation - source code saved on GitHub as celery task



[https://github.com/app-generator/app-generator/blob/main/apps/tasks/tasks.py](https://github.com/app-generator/app-generator/blob/main/apps/tasks/tasks.py)



Currently, the tool generates around 20 apps/day and the code is automatically saved on GitHub:



[https://github.com/app-generator?tab=repositories](https://github.com/app-generator?tab=repositories)



In the long run, the plan is to integrate more OAuth providers, DataTables, and a visual page builder.

Thanks for feedback & suggestions.

/r/django
https://redd.it/1hwdqy3
D ML Engineers, what's the most annoying part of your job?

i just know a phd just inspecting datasets and that sounds super sad

/r/MachineLearning
https://redd.it/1hwbhuj