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

Flowfile: Code-to-Visual. Now also Visual-to-Code: Generate polars code based on a visually

Hi r/Python

A few weeks ago, I shared the first version of Flowfile, my open-source Python tool for turning Polars-like code into visual ETL pipelines. The top requested feature was the reverse, and I'm excited to share that it's now ready.

You can now use a visual drag-and-drop editor to build a pipeline, and Flowfile will generate a clean, standalone Python script using lazy Polars. This completes the round-trip workflow: **Code <> Visual <> Code**.

* **GitHub Repo:** [https://github.com/Edwardvaneechoud/Flowfile/](https://github.com/Edwardvaneechoud/Flowfile/)
* **Quick Install:** `pip install Flowfile`
* **Live Demo (GIF):** [Demo](https://raw.githubusercontent.com/Edwardvaneechoud/Flowfile/refs/heads/main/.github/images/code-generator-gif.gif)

# What My Project Does

Flowfile is an open-source Python library that provides a bidirectional workflow for creating data pipelines. It allows you to:

1. **Write Polars-like Python code** and automatically generate an interactive, visual graph of your pipeline.
2. **(New Feature)** **Build a pipeline visually** using a drag-and-drop UI and generate a clean, standalone, high-performance Python script from it.

The entire backend is built with FastAPI and the data processing leverages Polars for its performance.

# You can write Python code like this...
import flowfile as ff
from flowfile import col, open_graph_in_editor

df = ff.from_dict({"id": [1, 2], "value": [100, 200]})


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

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

Python Daily

Hey learners! I'm starting a new coding + study grind — and you're invited to join. .

just real learning, helping each other, solving doubts, late-night sessions, and building cool stuff in this crazy AI era 🤖💻

if you’re learning to code (or want to start), join in!
python, web dev, AI tools, DSA – we’re figuring it out together.

let’s build skills, side projects & a study vibe that actually works 🧠
drop a “💬” if you’re in – i’ll send the group link.



https://discord.gg/faBnStU7

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

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

Python Daily

No open ports detected error on Render

I made a simple flask application and was trying to deploy it on render, however there was this constant error that kept coming up saying "No open ports detected, continuing to scan..." until the memory usage exceeded and it had to terminate the process. I have tried everything, I looked up the official docs of render to fix it, changing the default port to 10000 as per the docs but nothing is working no matter what. The start command I'm using is- gunicorn app:app --bind 0.0.0.0:$PORT. However I have tried different iterations of this too, like ${PORT} instead of $PORT or even hardcoding the port value but nothing works.
Please help me figure out what's wrong with this, here's the github repo, the root directory is "backend".
https://github.com/rithinagraj/pdf-chatbot-backend.git

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

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

Python Daily

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

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

Python Daily

Flask flash() displaying JSON-like string instead of message text

I'm working on a Flask application and I am encountering an unexpected issue with `flash()`messages.

I'm using the standard Flask `flash()` function in my Python backend:

from flask import flash, redirect, url_for, render_template

# ... inside a route, e.g., after successful registration
flash("Registration successful! Please complete your profile", "success")
return redirect(url_for('complete_profile'))


My Jinja2 template (base.html, which other templates extend) is set up to display flashed messages as recommended in the Flask documentation:

<div class="container mt-3">
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
{{ message }}


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

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

Python Daily

Does it make sense to use fully synchronous Django REST APIs with Gunicorn using the gthread worker class?

I have Django REST APIs that only make database calls using the ORM and external API calls using the Python requests package.
Is it really worth using the gthread class?
I am using 2 workers with 4 threads.

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

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

Python Daily

Have you ever migrated from Stripe to Ryft Pay?

How was the process, and how was handling large volume/throughput of payments after moving away from stripe?

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

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

Python Daily

Built my another full-stack e-bike rental platform - Django + React

Hey everyone!

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

I just finished **building an e-bike rental platform** and wanted to share it with you all. It's basically like Airbnb but for electric bikes.What it does:

* People can list their e-bikes for rent
* Others can search and book those bikes
* Has a booking system with calendar dates
* Photo uploads for bike listings
* User reviews and ratings
* Mobile responsive design

Tech I used:

* Backend: Django REST Framework + PostgreSQL
* Frontend: React + TypeScript + Tailwind CSS
* Authentication with JWT tokens

Features I'm proud of:

* You can filter bikes by type, location, and price
* The booking process is pretty smooth (date picker, payment info, confirmation)
* Bike owners can manage their listings and see booking requests
* Added a favorites system so users can save bikes they like

I built this project in my free time.

GitHub: [https://github.com/manjurulhoque/BoltBike](https://github.com/manjurulhoque/BoltBike)

I put screenshots in the repo so you can see how it looks.
Would love to hear what you think or if you have any suggestions for improvements!

Thanks for checking it out 🚴‍♂

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

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

Python Daily

Deploying to VPS , Postgres slowdown

Hi everyone,

I'm using django-debug-toolbar to look at my query times on my local machine and i'm trying to optimize it as best i can so i keep my load times as low as possible.

On my local machine debug-toolbar states '12 queries in 2.73ms'.

I ran the same settings, same project, same DB copy on a \~25 EUR VPS on hetzner and i got this: '12 queries ran in 28.1ms'.

Now, my logic is that if i have the webserver (django+nginx) and the database (postgres) on the same machine, then the query times should be relatively close, since django communicates with the DB on localhost, so no reason for a slowdown.

I get that the final HTML will be sent much slower since the server is \~500km from me and not 50cm.

Again, Postgres and Django is on the same machine, and the same query takes 10x as much time for some reason.

Is my logic wrong or am i doing something very wrong when deploying to a VPS?

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

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

Python Daily

Real world flask projects

Hey. I’m learning flask as of now and tutorials focus on simpler task/projects that don’t show using of flask on its full extend. Additionally to that each tutorial skips or copy pastes all other things that aren’t of directional relation to flask. It is ok I guess since they are trying to teach me flask, but would want to see a real flask project to understand how devs use it in real world applications and how they couple it with other tools/frameworks. Could anyone share a GitHub link where I could find it?

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

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

Python Daily

Why is there no python auto-instrument module for open telemetry ?

Hi all,

I use open telemetry auto-instrumentors to get insights of my python application. These auto-instrumentors will instrument particular modules:

* [fast-api auto instrumentor](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-fastapi)
* [openai auto instrumentor](https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation-genai/opentelemetry-instrumentation-openai-v2)
* etc...

As far as I understand, these modules will create spans for different events (fastapi request, openai llm call etc..), adding inputs and outputs of event as span attributes

# My question:

Why isn't there a python auto instrumentor that will create a span for each function, adding arguments and return values as attributes ?

Is it a bad idea to do such auto instrumentor ? Is it just not feasible ?


## Edit :
For those who are interested, I have coded an auto-instrumentor that will automatically create a span for the functions that are called **in user code** (not in imported modules etc...)

Check it ou there [repo](https://github.com/le-codeur-rapide/opentelemetry-instrumentation-python/tree/main/examples)

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

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

Python Daily

Deploy Django on Render

Ever Wanted to Deploy Django to Render?

The tutorial below demonstrates how you can deploy Django to render for free and also have a PostgreSQL database at neon and store your media assets at cloudinary, all for free.

Check it out - simply legendary!

https://youtu.be/VUFg\_ov6b\_4?si=DeOSnXOFmTv6SkfK

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

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

Python Daily

Anyone successfully hosted on Plannethoster?

Trying to host my first Django/HTML project on Plannethoster as I'm with them for other projects, so thought how hard can it be 😵‍💫

Now I've read though the docs on the site about python and Django project, but I seem to be missing something or they have changed something 🤷 an their support support are not very helpful with it.

From what I've read you need to create the python app and navigate to via terminal, then in stall Django and a Django app, or instead of the Django app you upload you own.

But there's nothing on does it need to be in the app folder you created for the python app before, or can it be in a subfolder? Do I have to upload from their file manager or can I do it from git?

I'm sure there's more questions after this as it seems very convoluted in the setting up.

Thanks for your help and your time, if you have any knowledge on this.

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

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

Python Daily

Project RCPTelegram – A Telegram Bot to Remotely Control Remotely your PC

---

Project RCPTelegram – A Telegram Bot to Remotely Control Your PC (Webcam, Screen, Keylogger, Pranks & More)


---

🔧 What My Project Does

RCPTelegram is a Telegram bot that lets you remotely control your PC via chat commands. Some of the features include:

📸 Streaming your webcam and screen (via ngrok tunnels)

🖼️ Taking screenshots and webcam photos

⌨️ Keylogger

📶 Getting saved Wi-Fi passwords

🌍 Grabbing your public IP

🔊 Setting volume and managing output devices

🎭 Pranks and other fun tools

🔩 Many system automation commands (power, sleep, lock, etc.)


All features are accessible from a single Telegram chat — no GUI needed.


---

🎯 Target Audience

This is not meant for production — it's a toy/educational project designed to explore remote PC control using Python and Telegram. It’s great for learning purposes, automation experiments, or building your own personal remote assistant.


---

⚖️ Comparison to Existing Tools

Unlike commercial tools like TeamViewer or AnyDesk:

🟢 This works headlessly via Telegram

🛠️ Fully scriptable and open-source

🔌 Uses ngrok for quick and easy tunneling

🎉 Has playful features (like pranks) you won’t find in standard tools

🧩 You can modify and extend it however you like



---

🗂️ Links

Bot Code: https://github.com/RiccardoZappitelli/RCPTelegram

GUI Builder: https://github.com/RiccardoZappitelli/RCPTMaker



---

Let me know what features you’d add or how you'd improve it. I’m also planning to split the code into multiple

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

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

Python Daily

Django CSS Production not loading

Refused to apply style from because its MIME type ('text/html') is not a supported stylesheet MIME

settings.py

BASEDIR = Path(file).resolve().parent.parent

STATIC
URL = '/static/'
STATICROOT = BASEDIR / 'staticfiles'
STATICFILESDIRS = [
    BASE
DIR / 'myapp' / 'static',
]

base.html

<link rel="stylesheet" href="{% static 'styles.css' %}" />

I also am running

python manage.py collectstatic --noinput

So when I am in production its picking up nothing in my static folder I'm so confused help please!

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

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

Python Daily

How to exclude usablepassword field from AdminUserCreationForm

Django 5.1 introduced this new AdminUserCreationForm that comes with a password-based authentication field and im trying to disable:

class CustomUserCreationForm(AdminUserCreationForm):
class Meta:
model = get
usermodel()
exclude = (usable
password,)

But is not working, this field section always comes with form. How can I fix this? Sorry bad english

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

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

Python Daily

A Python library to reliably detect captive portals and TLS interception (Man in the middle) attacks

Hey all,

For a personal project (a Raspberry Pi powered hotspot + VPN), I needed to solve a problem that basic connectivity checks can't handle: how do you really know if you're on the internet, or just stuck behind a smart captive portal?

**What My Project Does**

captive-portal-detector is a Python library that provides a fast high confidence verdict on the true state of a network connection. Instead of just checking for connectivity, it determines if the network is:

1. OK: Open, secure, and free from tampering.
2. CAPTIVE: Blocked by a captive portal (e.g., a hotel login page) or actively being intercepted by a Man-in-the-Middle (MITM) attack.
3. NO\_INTERNET: Genuinely disconnected or unable to reach any trusted endpoint.

The library uses a multi-layered strategy, running several types of probes in parallel for speed and accuracy:

* HTTP Probes: Checks against standard endpoints to detect simple captive portal redirects.
* Random Host Probe: Defeats "smart" whitelisting portals by testing against a dynamically generated, unknown domain.
* Redundant, Pinned TLS Probes: Uses SPKI Public Key Pinning against two independent, user-controlled servers. This is the core feature, enabling the detection of sophisticated interception attacks used by corporate or state-level firewalls.

Out of the box, it's pinned against two redundant servers I set up

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

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

Python Daily

Stockstir is a Python library to get stock information from any script at no cost CLI released!

Hello again!

Wanted to showcase my project, Stockstir, which may be of use to many of you that want to follow stock prices freely in any script. CLI has just been released!

What My Project Does

Stockstir is an easy way to instantly gather stock data from any of your Python scripts. Not only that, but it includes other features, such as multi data gathering, anti ban, a fail-safe mechanism, random user agents, and much more.

Target Audience

Stockstir is for everyone that needs to gather realtime company stock info from any of their scripts. It mostly differs from any other stock related project in the way that it is simple, and doesn't rely on APIs that cost money.

Comparison

Stockstir differs from other methods of gathering stock data in that it is has a very simple concept behind it. It is largely a GET wrapper in the Tools class, but initial API support such as Alpha Vantage, as well as gathering much more data of a Company stock through cnbc's JSON api, are under the API class. It mostly serves as a quick and simple way to gather stock data.

You can find installation instructions and other information under the project link provided below:

Link: Stockstir Project Link

To see

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

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

Python Daily

what’s the best AI workflow for Jupyter?

I recently discovered # %% in .py files create cells as .ipynb aren’t very compatible with cursor functions. but is there a gold standard already for Jupyter workflows?

/r/IPython
https://redd.it/1l7bviv

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

Python Daily

pyfuze 2.0.2 – A New Cross-Platform Packaging Tool for Python

# What My Project Does

**pyfuze** packages your Python project into a **single executable**, and now supports **three distinct modes**:

|Mode|Standalone|Cross-Platform|Size|Compatibility|
|:-|:-|:-|:-|:-|
|**Bundle** *(default)*|✅|❌|🔴 Large|🟢 High|
|**Online**|❌|✅|🟢 Small|🟢 High|
|**Portable**|✅|✅|🟡 Medium|🔴 Low|

* **Bundle mode** is similar to PyInstaller's `--onefile` option. It includes Python and all dependencies, and extracts them at runtime.
* **Online mode** works like bundle mode, except it **downloads Python and dependencies at runtime**, keeping the package size small.
* **Portable mode** is significantly different. Based on [python.com](https://github.com/jart/cosmopolitan/wiki/python.com), it creates a truly standalone executable that **does not extract or download anything**. However, it only supports **pure Python projects and dependencies**.

# Target Audience

This tool is for Python developers who want to **package and distribute** their projects as standalone executables.

# Comparison

The most well-known tool for packaging Python projects is **PyInstaller**. Compared to it, **pyfuze** offers two additional modes:

* **Online mode** is ideal when your users have reliable network access — the final executable is only a few hundred kilobytes in size.
* **Portable mode** is great for simple pure-Python projects and requires **no extraction, no downloads**, and works across platforms.

Both modes offer **cross-platform compatibility**, making **pyfuze** a flexible choice for distributing Python applications across Windows, macOS, and Linux. This is made possible by the excellent work of the [uv](https://github.com/astral-sh/uv)

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

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

Python Daily

Why Django Feels Underrated in Modern Development — A Take on Its Limitations and Future Potential

>I’m a Full Stack developer and have been using Django seriously for the past few year for my personal and organization projects. The more I use it, the more I feel it’s one of the most powerful and reliable web frameworks out there. But at the same time, I keep noticing that Django doesn’t get the hype or recognition it deserves in modern development circles.

Here’s my perspective on why Django feels underrated today, what limitations I’ve personally run into, and what I think could make it the go-to framework again in the modern dev world.

1. Django isn't designed for SPAs by default Right now, the industry heavily leans toward frontend frameworks like React, Vue, Svelte, etc. Django is still very template-focused out of the box. And yes, Django REST Framework (DRF) helps a lot, but it doesn’t feel like the framework is meant to play well with modern JS apps by default. I’ve had to glue a lot of things together manually to make Django work as a backend for SPAs.
2. Async support came too late and still feels half-baked I know Django now supports async views and middleware, but async ORM is still not fully stable, and a lot

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

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

Python Daily

Football Tournament Maker V1.0

It is an open source web program designed by me you can modify it easily
🔹html
🔹css
🔹javascript
🔹python-flask


https://youtu.be/SMvMQYZiggQ

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

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

Python Daily

Robyn (finally) supports Python 3.13 🎉

For the unaware - Robyn is a fast, async Python web framework built on a Rust runtime.

Python 3.13 support has been one of the top requests, and after some heavy lifting (cc: cffi woes), it’s finally here.

Wanted to share it with folks outside the Robyn bubble.

You can check out the release at - https://github.com/sparckles/Robyn/releases/tag/v0.68.0

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

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

Python Daily

Looking for senior python API developer

Looking for a remote Python developer to build and maintain APIs (Django), automate SSL checks, and scale backend systems.
• 🛠 Stack: Python, Django, FastAPI, Docker, PostgreSQL, ASB
• 🌍 Fully remote (worldwide)
• 💰 Competitive pay + equity potential

DM for details


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

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

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

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

Python Daily

Docker container running not able to reach localhost

Hi All,

There is an issue that I am facing where I am trying to run the application on docker container. Docker build works absolutely fine. The container is running as well but I am not able to reach the application.

Dockerfile

FROM python:3.10
EXPOSE 5000
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY . .
CMD ["flask", "run", "--host","0.0.0.0"]

Docker Run Command

docker build -t flask-smorest-api .
docker run -dp 5005:5000 -w /app -v "$(pwd):/app" flask-smorest-api

Container Logs

Serving Flask app 'app'
Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
Running on all addresses (0.0.0.0)
Running on http://127.0.0.1:5005⁠
Running on http://172.17.0.2:5005
Press CTRL+C to quit
Restarting with stat
Debugger is active!
Debugger PIN: 502-466-638


When i am trying to access the endpoint from POSTMAN there is

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

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

Python Daily

🎬 MovieHit.online - A Django-powered movie discovery web app I built

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

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

Python Daily

Django tip Component-Based Design With Django Cotton

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

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

Python Daily

Help Django ModuleNotFoundError when deploying to Render

I'm struggling with a deployment issue on Render with my Django project.I'm struggling with a deployment issue on Render with my Django project. When deploying, I get
ModuleNotFoundError: No module named 'accounts'
Project Structure:
portfolio_app/
└── django_portfolio_app/
├── portfolio_app/
│ ├── __init__.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── accounts/
├── projects/
├── resume/
├── forum/
├── theme/
│ └── static/
└── manage.py
I did specify in the render deployment settings that django_portfolio_app is the root directory. No idea where to go from now on, as I'm stuck on this error since yesterday. Thanks for any advice and feedback

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

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

Python Daily

Audited SSS (shamir shared secret) code?

I’m currently looking for audited implementations of Shamir’s Secret Sharing (SSS). I recall coming across a dual-audited Java library on GitHub some time ago, but unfortunately, I can’t seem to locate it again.

Are there any audited Python implementations of SSS available? I've searched extensively but haven't been able to find any.

Can anyone found some? I'm thinking about: https://github.com/konidev20/pyshamir but I don't know.

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

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