Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
How can I access currentuser outside of an route.
Hello, im trying to make a polling mechanism, so im making a background process using "ThreadPoolExecutor", I added a status boolean to my users table so they will only be able to send 1 request at time, but i´ve ran into a problem where I cant change the current\user.status to False after the background process is over since its outside of an route.
def backgroundtranslation(filecontent, wmodel, transcription, model, pitch, speechrate, userid):
try:
srtfile = whispertranscribe(filecontent, wmodel, transcription)
audio = texttospeech(srtfile, model, pitch, speechrate)
output = addstream(audio, filecontent)
# Save as userid.mp4
destination = os.path.join(CONTENTFOLDER, f"{userid}.mp4")
shutil.move(output, destination)
print(f"Translation complete: saved to {destination}")
/r/flask
https://redd.it/1l8uuq3
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1l987wu
How to deploy my flask web app
I used Google AI Studio to create a web-based customer management and payment collection dashboard, primarily designed for cable operators. It was built using Flask (Python) and Bootstrap (HTML/CSS). This application helps manage customers, track payments, generate reports, and provide actionable business insights. The website looks good and is useful to me, but I want to deploy it on the internet. I have watched many tutorials on YouTube, but none of them worked for me. I tried platforms like Vercel, Render, Railway, and more, but they gave me various errors. I am a beginner and not very familiar with the code, so can you please help me? I will provide the GitHub source code link.
/r/flask
https://redd.it/1l8uirt
Is Python really important for cybersecurity?
I've seen some people saying that Python isn't really necessary to get started in the field, but I began learning it specifically because I plan to move into cybersecurity in the future. I’d love to hear from people already working in the area — how much does Python actually matter?
/r/Python
https://redd.it/1l95skp
Juvio - UV Kernel for Jupyter
Hi everyone,
I would like to share a small open-source project that brings uv-powered ephemeral environments to Jupyter. In short, whenever you start a notebook, an isolated venv is created with dependencies stored directly within the notebook itself (PEP 723).
🔗 GitHub: https://github.com/OKUA1/juvio (MIT License)
What it does
💡 Inline Dependency Management
Install packages right from the notebook:%juvio install numpy pandas
Dependencies are saved directly in the notebook as metadata (PEP 723-style), like:
# /// script
# requires-python = "==3.10.17"
# dependencies =
# "numpy==2.2.5",
# "pandas==2.2.3"
#
# ///
⚙️ Automatic Environment Setup
When the notebook is opened, Juvio installs the dependencies automatically in an ephemeral virtual environment (using uv), ensuring that the notebook runs with the correct versions of the packages and Python.
📁 Git-Friendly Format
Notebooks are converted on the fly to a script-style format using # %% markers, making diffs and version control painless:
# %%
%juvio install numpy
# %%
import numpy as np
# %%
arr = np.array(1, 2, 3)
print(arr)
/r/Python
https://redd.it/1l8xwsc
Project Generate Beautiful Chessboard Images from FEN Strings 🧠♟️
Hi everyone! I made a small Python library to generate beautiful, customizable chessboard images from FEN strings.
What is FEN string ?
FEN (Forsyth–Edwards Notation) is a standard way to describe a chess position using a short text string. It captures piece placement, turn, castling rights, en passant targets, and move counts — everything needed to recreate the exact state of a game.
🔗 GitHub: chessboard-imagepip install chessboard-image
# What My Project Does
Convert FEN to high-quality chessboard images
Support for white/black POV
Optional rank/file coordinates
Customizable themes (colors, fonts)
# Target Audience
Developers building chess tools
Content creators and educators
Anyone needing clean board images from FEN It's lightweight, offline-friendly, and great for side projects or integrations
# Comparison
python-chess
supports FEN parsing and SVG rendering, but image customization is limited
Most web tools aren’t Python-native or offline-friendly
This fills a gap: a Python-native, customizable image generator for chessboards
Feedback and contributions are welcome! 🙌
/r/Python
https://redd.it/1l8hdwz
Hi Guys! I know Django and started learning RestAPI . So what projects I can make with these two only. Any Playlist or GitHub Repo
Sams as title.
/r/djangolearning
https://redd.it/1l6lr1v
Need advice about managing codebase
So, for starters this is the first real website I've made. The website is a combination of html/css/js on the front, with Django and a sqlite3 database on the back end. Currently I have about 50 paying users and I'm expecting it to increase to the hundreds next year. Concurrent users is usually fairly small and my webserver stats show <2% load on the smallest virtual server they offer.
What I've been doing is buildling on an Ubuntu VM on my computer, testing and such, then I run a deploy script to SSH to my real server in the cloud, upload the changed source code, then bounce gunicorn and the new version of the code is live (adding new games/quizzes mostly). The database gets updated manually - the deploy script makes a backup - by using an import script against the .csv file the data is in. New questions might be in the format of questions.csv
category,question,answer1,answer2,answer3,answer4,difficulty
all of my code is in a giant views.py file that is nearly 2000 lines long (I'm using VSCode). Is this the normal way of doing things? Right now to make it easier
/r/django
https://redd.it/1l86aa3
Just finished a beginner Python course – is it worth learning Django now with AI advancing so fast?
Hi everyone,
I just finished a beginner Python course and I'm planning to start learning Django to get into backend development. But recently, I've been seeing a lot about AI tools like ChatGPT, Copilot, etc., being able to generate code, build APIs, and automate a lot of what backend developers do.
So now I'm wondering — is it still worth learning Django and backend development from scratch in 2025, or will most of this work soon be handled by AI?
I'm not expecting to be replaced tomorrow or anything, but I’m just unsure if it's a good long-term path or if I should shift toward something more future-proof.
A few questions I’d really appreciate input on:
Is backend development (with Django or similar frameworks) still a good skill to invest time in?
Will learning it help me become a better developer even if AI helps with code generation?
For those already working in the field, has AI significantly changed how backend work is done?
Would love to hear your thoughts or advice from anyone who's a bit further along!
Thanks in advance.
/r/djangolearning
https://redd.it/1l6a3ki
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/1l8egg6
Project FileVault – A Secure File Storage CLI Tool (Compression + Encryption + TUI)
Hello Python devs,
I recently finished building FileVault, an Encrypted file storage tool with an interactive terminal user interface.
🎥 Demo video:
👉 https://www.youtube.com/watch?v=YXFQwEj1E1k
📦 GitHub repo:
👉 https://github.com/MazenYasser/file-vault-python
⸻
What my project does
• Lets you upload any file from your system via the terminal.
• Files are compressed using Zstandard (zstd).
• Then encrypted with a Fernet key, protected by PBKDF2 + user password.
• You can later download and decrypt files with just a few keypresses.
• It has a clean terminal UI using questionary, with navigation, path validation, progress bars, and contextual menus.
• Everything is local
⸻
Target audience
• People who spend most of their time in the terminal or enjoy TUI more than GUI (I know I do)
• Anyone who wants a secure and simple way to store files, even just for fun.
⸻
Comparisons
This isn’t trying to be a full-blown alternative to other tools.
FileVault is:
• More educational and exploratory in nature.
• Offers a simple, guided, TUI experience.
• It is a side project, mainly for learning streaming I/O, encryption, config handling and modular project structure.
⸻
Backstory
I watched ThePrimeagen">ThePrimeTime’s video: https://www.youtube.com/watch?v=UowtlZB2a70 reacting to the article “Be an engineer, not a frameworker.”
That really stuck with me. So I embarked on learning lower level programming concepts, to learn the inner workings of tools I use, even though I primarily work with Django. This started with
/r/Python
https://redd.it/1l872q5
Is my flask app structured okay or are there better ways to structure the flask app?
I have a flask app structured similar to this https://github.com/miguelgrinberg/microblog Here is my file-path in the app in powershell. (my_env) PS C:\Users\user\Downloads\myapp\app>
The first picture is myapp folder and files within them
https://imgur.com/a/OUOtQ5N
The second picture is app folder and files within them though I removed some names because I am working on an original idea
Everything seems to be working the problem is when I try to import from models.py, in the User
class and __init__.py
in the app folder the problem is when I try to import from myapp.models import User
it doesn't work. But when I try from ..models import User
it does work.
Any reason the 2 dots work in the second import example but the first import example does not work?
Also am I correct folder?
Should I setup my flask app like https://github.com/miguelgrinberg/microblog ?
Here is my config.py.
https://pastebin.com/YNsnjHPP
Here is my __init__.py folder in the app folder.
https://pastebin.com/8g1TmEm4
Thanks
/r/flask
https://redd.it/1l84lip
Is it worth learning Django in 2025
I'm really confused if i should continue my learning journey in web development and Django . Like every 2 months a AI update comes and every one starts talking about creating a website without coding and Everywhere is like " THIS company fired THIS many Developers " . I am just new and feeling really stuck . Plz someone clarify this
/r/django
https://redd.it/1l8045w
I turned a thermodynamics principle into a learning algorithm - and it lands a moonlander
Github project and demo videos (please use a web browser if possible, as Github Mobile app does not properly render some videos)
What my project does
Physics ensures that particles usually settle in low-energy states; electrons stay near an atom's nucleus, and air molecules don't just fly off into space. I've applied an analogy of this principle to a completely different problem: teaching a neural network to safely land a lunar lander.
I did this by assigning low "energy" to good landing attempts (e.g. no crash, low fuel use) and high "energy" to poor ones. Then, using standard neural network training techniques, I enforced equations derived from thermodynamics. As a result, the lander learns to land successfully with a high probability.
Target audience
This is primarily a fun project for anyone interested in physics, AI, or Reinforcement Learning (RL) in general.
Comparison to Existing Alternatives
While most of the algorithm variants I tested aren't competitive with the current industry standard, one approach does look promising. When the derived equations are written as a regularization term, the algorithm exhibits superior stability properties compared to popular methods like Entropy Bonus.
Given that stability is a major challenge in the heavily regularized RL used to train today's LLMs, I guess it
/r/Python
https://redd.it/1l7y0zh
Flask-Manage-Webpack is GONE... why?
Hi, so in a project i used Flask-Manage-Webpack but it was removed from PyPI and from Github. Does anyone know why? It's a rather trivial module so we'll survive but it's not great ;-)
/r/flask
https://redd.it/1l7tr0y
Deploying to vercel
How can i deploy a flask app to vercel with these requirements:
flask==3.0.2
flask-cors==4.0.0
scikit-learn==1.4.1.post1
numpy==1.26.4
xgboost==2.0.3
pandas==2.2.0
tensorflow-cpu==2.16.1
I am getting a maximum size of 300mb file limit
Note: I am using python 3.11 in my local flask app
/r/flask
https://redd.it/1l9d6xi
What was your first Django application?
Mine was accounting application for my trader character in EVE Online.
It read my buy/sell transactions from the official API, parsed the data with xml.sax, and calculated the profit margin per item. Also, it used special html tags for EVE's in-game browser.
/r/django
https://redd.it/1l8nr9n
Building Dynamic Django Forms
Hi guys, whats your proven strategy (and/ or library) for building dynamic django forms that can span multiple pages with save point.
/r/django
https://redd.it/1l8vonr
Host your flask app on AWS for free
Just wanted to share another method of hosting your app in a serverless manner using AWS, best part is for most projects it's free as it's well covered by the free tier's generous monthly million requests
We use zappa to package our app and push to Aws with an API gateway that is integrated with our flask packaged as a lambda function. Any API calls will then be routed by zappa's handler to appropriate Flask app's endpoints
Created a YouTube tutorial on this today: https://youtu.be/6Bk-hpI1mNA?si=GqrzhiduAwSKJjAf
Appreciate any feedback, thanks!
/r/flask
https://redd.it/1l8zdgg
Should I really use React/Vue with Django instead of alpine js?
I've been using alpine js and I was happy with it. Let me cut to the chase
How it works now: I have a page where user creates an instance. An instance has a bunch of characteristics and foreign key to product (which has category and name itself) and all the fields are static - just stylized selects and inputs, but there is just a change event handler which saves any changes in session so that user could go back to editing
What I'm trying to do: with alpine I replaced two selects (where user chooses product category and product name) with a single button - "select a product" and after clicking a modal appears with options depending on the step - either category or name, once both category and name are selected a card with this product appears and a button turns into "change a product"
What's wrong: everything worked just fine until I started filling this mess with initial values from draft form, so that you need to combine django {% if %} with alpine x-if which turned into a horrible flickering mess
P.S I also have tried using Vue js alongside django with SFC component and i really love it, especially
/r/django
https://redd.it/1l8vc1s
What version do you all use at work?
I'm about to switch jobs and have been required to use only python 3.9 for years in order to maintain consistency within my team. In my new role I'll responsible for leading the creation of our python based infrastructure. I never really know the best term for what I do, but let's say full-stack data analytics. So, the whole process from data collection, etl, through to analysis and reporting. I most often use pandas and duckdb in my pipelines. For folks who do stuff like that, what's your go to python version? Should I stick with 3.9?
P.S. I know I can use different versions as needed in my virtual environments, but I'd rather have a standard and note the exception where needed.
/r/Python
https://redd.it/1l8chj0
How to "reverse engineer" your junior django developer job search.
/r/django
https://redd.it/1l8ph3g
Starting django
Want to start with django I know models and all, I recently built a form where you can submit info and click a photo and the photo will be redirected to another page, but where do I start learning like things
/r/django
https://redd.it/1l8jdu6
Is uvloop still faster than asyncio's event loop in python3.13?
Ladies and gentleman!
I've been trying to run a (very networking, computation and io heavy) script that is async in 90% of its functionality. so far i've been using uvloop for its claimed better performance.
Now that python 3.13's free threading is supported by the majority of libraries (and the newest cpython release) the only library that is holding me back from using the free threaded python is uvloop, since it's still not updated (and hasn't been since October 2024). I'm considering falling back on asyncio's event loop for now, just because of this.
Has anyone here ran some tests to see if uvloop is still faster than asyncio? if so, by what margin?
/r/Python
https://redd.it/1l8fwu1
Could you assist me with this issue? This glitch appears in all browsers; why doesn't the scrolling function properly in my notebook?
https://redd.it/1l7x692
@pythondaily
Academic study on code debugging
Hi everyone, I’m conducting a short experiment for my master’s thesis in Information Studies at the University of Amsterdam. I’m researching how people explore and debug code in Jupyter Notebooks.
The experiment takes around 15 minutes and must be completed on a computer or laptop (not a phone or tablet). You’ll log into a JupyterHub environment, complete a few small programming tasks, and fill out two short surveys. No advanced coding experience is required beyond basic Python, and your data will remain anonymous.
Link to participate: https://jupyter.jupyterextension.com Please do not use any personal information for your username when signing up. After logging in, open the folder named “Experiment_notebooks” and go through the notebooks in order.
Feel free to message me with any questions. I reached out to the mods and they approved the post. Thank you in advance for helping out.
/r/Python
https://redd.it/1l81fjc
Built a website to train spotting the worst move in Chess
What My Project Does
It’s a site and puzzle-building tool for training yourself to spot the worst move in a chess position. Instead of solving for the best or most accurate move, you try to find the move that completely falls apart. hangs a piece, walks into mate, or otherwise ruins the position.
The idea started as a joke, but it came from a real problem: I’m not a great chess player, and I realized my biggest issue was missing threats while focusing too much on attacking. My defensive awareness was weak. So I thought what if I trained myself to recognize how not to play?
It turned out to be a fun and occasionally useful way to train awareness, pattern recognition, and tactical blunder detection.
Target Audience
This is mostly a side project for casual and improving players, or anyone who wants a different take on chess training. It’s not meant for production-level competitive prep. Think of it more as a supplement to traditional study or just a chaotic way to enjoy tactics training.
Comparison
There aren’t any real alternatives I know of. Most chess training tools focus on optimal or engine-approved lines this flips that. Instead of “play like
/r/Python
https://redd.it/1l84p2i
Advice needed Django/DRF
Okay so, might be a long one.
I've been self-teaching myself programming for over a year now, initially just some python etc. (I dont want a degree pls dont focus on this point)
I decided to follow the general roadmap.sh routes and i ended up falling into Django, it seemed like something that would click with me.
I did Corey Schafers tutorial on Django, and i started and changed up the tutorial as i went, creating a resume-esque project.
After trying (and failing) to integrate my own app, i decided to take a pause on this project for awhile. I then followed the Django docs tutorial (official) and decided "I'll start with making and adding one API here"
I then noticed everything mentioning "REST frameworks" so i began with the Django Rest framework, and started the quickstart tutorial.
I now plan to go through the other tutorials for DRf. However i noticed... most of my current resume project seems... outdated for standards? I mean i created all the classes views etc without using DRF.
So now im at this point, where i still don't understand Django/DRF quite well, and I'm kind of confused. I feel like it's all a little
/r/djangolearning
https://redd.it/1l6wj31
Welcome to r/djangolearning
This post contains content not supported on old Reddit. Click here to view the full post
/r/djangolearning
https://redd.it/1l4ynd5
I created Cerno - a local-first AI deep research workspace
https://redd.it/1l7wlsg
@pythondaily