Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels
GRPO VRAM Requirements For the GPU Poor
Hey all, I spent some time digging into GRPO over the weekend and kicked off a bunch of fine-tuning experiments. When I saw there was already an easy to use implementation of GRPO in the trl
library, I was off to the races. I broke out my little Nvidia GeForce RTX 3080 powered laptop with 16GB of VRAM and quickly started training. Overall I was pretty impressed with it's ability to shape smol models with the reward functions you provide. But my biggest takeaway was how much freaking VRAM you need with different configurations. So I spun up an H100 in the cloud and made table to help save future fine-tuners the pains of OOM errors. Hope you enjoy!
Full Details: https://www.oxen.ai/blog/grpo-vram-requirements-for-the-gpu-poor
Just show me the usage:
All the runs above were done on an H100, so OOM here means > 80GB. The top row is parameter counts.
https://preview.redd.it/4hjjzrf5xghe1.png?width=6304&format=png&auto=webp&s=46397d3e2bbdae61845a88afa96f0dce9e981047
/r/MachineLearning
https://redd.it/1iiwwcc
DjangoMatrix.com - A community driven project (Call for contributors)
Hey guys 👋
Ever spent way too much time Googling “*does \[cool Django package\] work with Django 5.0?*”… only to find outdated forum posts and crickets? Yeah, me too. That’s why I've built **DjangoMatrix** — a community-powered directory to track package compatibility, activity, and alternatives. Think of it like a friendly neighborhood wiki, but for Django packages.
And guess what? It could use your help to make it actually useful for all of us.
**What's DjangoMatrix all about?**
Look, Django packages are amazing… until they’re abandoned, or break with the latest Python/Django versions. And I thought we could all use a place where we can see compatibility at a glance.
**Some interesting things about DjangoMatrix:**
* **Built with Django** (Duhh). And it's open-source. You can find link to its repository in the lower right corner.
* **Fresh GitHub Data**: Every day, the system fetches data from GitHub for the published Packages, ensuring that the information stays current.
* **Dynamic Graphs**: We plot graphs showing the movement of Stars, Forks, and Issues over time, giving you a visual insight into project trends.
* **Optimized Details Page**: A caching system is in place for our details page, meaning faster loading times and smoother navigation.
* **Similar Packages Discovery**: By analyzing
/r/django
https://redd.it/1ij1bwf
Unsure how to run data pipeline within flask
2 Quick Questions:
Quick overview: Only used flask before for a crappy blog. No js or webdev experience. I am building a basic stock watching app. I would like users to be able to watch the last few minutes of trading data then have it deleted.
1. I wrote the data pipeline before i started the website. It follows the typical consumer / producer pattern and everything is async. Do i need some kind of worker to run it? I was hoping to run it in its own thread and just emit the data directly from the consumer once it comes in. I don't think i need another message broker in between? Seems unnecessary
2. I am unsure how to handle the trading data. Currently i am writing the data to redis with a TTL and redis-om but i am unsure if this will work. If i get a new update i take it and place it in redis. Ok but how do i / redis now let socketio know there is a new update and it needs to send a new msg to the frontend to re-render the chart. How does charts.js (what i was told to use) access
/r/flask
https://redd.it/1iiqejq
How do you Github Actions pipelines look to deploy updates to Django apps to your VPS?
How to avoid conflicts? Especially with database
/r/django
https://redd.it/1iie89m
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/1iioxzg
Must know Python libraries, new and old?
I have 4YOE as a Python backend dev and just noticed we are lagging behind at work. For example, I wrote a validation library at the start and we have been using it for this whole time, but recently I saw Pydantic and although mine has most of the functionality, Pydantic is much, much better overall. I feel like im stagnating and I need to catch up. We don't even use Dataclasses. I recently learned about Poetry which we also don't use. We use pandas, but now I see there is polars. Pls help.
Please share: TLDR - what are the most popular must know python libraries? Pydantic, poetry?
/r/Python
https://redd.it/1iif99x
JUPYTER NOTEBOOK ASSIGNMENT—NITROGEN HUMO LUMO
# 1. Continue Working on the Sheet
* Ensure all calculations are correctly formatted and documented.
# 2. HOMO and LUMO Calculations
* Perform calculations for HOMO (Highest Occupied Molecular Orbital) and LUMO (Lowest Unoccupied Molecular Orbital).
* Clearly label results and include any relevant parameters used.
# 3. Document Intermediates
* Create a separate document compiling all notes related to reaction intermediates.
* Ensure clarity so that everything is easy to follow and distinguish.
# 4. Preparation for Next Week
* Be prepared to explain the mechanism of Electrophilic Aromatic Substitution (EAS).
* Organize your notes and be ready for a walkthrough discussion.
Based on the completion of nitrogen of acetophenone (previous Jupyter Notebook assignment): [Nitration of acetophenone](http://localhost:8889/notebooks/Documents/PythonProject/Nitration%20of%20acetophenone.ipynb)
\[Hint: One notebook only.\]
/r/IPython
https://redd.it/1iifsdb
How frequently do you use parallel processing at work?
Hi guys! I'm curious about your experiences with parallel processing. How often do you use it in your at work. I'd live to hear your insights and use cases
/r/Python
https://redd.it/1ii1i6z
Flask limits with many users?
I developed a webapp in flask using jinja2 as frontend. It is now being hosted on a AWS EC2 server and the project is getting big in terms of users. Shall I start thinking about to change my backend technology or flask could still work? How many users could it support taking into consideration it is just about to do some simple query to my database?
Thank you guys
/r/flask
https://redd.it/1ii5tzy
D What are current UNPOPULAR research topics in computer vision and language technology? 2025
No, I don't want to hear more about LLM and VLM anymore.
/r/MachineLearning
https://redd.it/1ihzy00
Are all inputs for "filter" method safe from sql injection?
Hi.
i'm making a simple online store app for learning purposes. For item properties, i've used a json field to store properties like size, color and .... . I've considered using database relations but i figured this would be simpler. the item properties are stored in db like this: {"size": "XL", "color": "red"}
I'm implementing a simple search functionality and since there are many properties, i'm wondering if it's safe to get property names from users.
was using json field a bad choice? what would a be good replacement?
this is my code for search view:
def search_items(request):
q = request.GET.get('q')
filters = request.GET.get('filters')
items = Item.objects.filter(name__icontains=q)
if filters:
options = {}
filters_list = json.loads(filters)
for f in filters_list:
options[f"properties__{f[0]}__icontains"] = f[1]
items = items.filter(**options)
return
/r/djangolearning
https://redd.it/1icran1
Corey Schafer's Django Blog Tutorial
Hey guys! I was just reaching out to see if anyone else has completed finishing this series. I'm looking to get some help because on video 13, right before deploying, I had issues setting up my aws S3. I ran a test script to see if sending a file locally would work and it worked. However, if I run my blog locally and update a profile picture, a new image would be added in my local media folder but not in S3. I made sure to set up my environment variables correctly and to set up my aws stuff according to the video. Anything helps! I also know this is very vague so please feel free to ask what i've tried so far. Thank you!
/r/django
https://redd.it/1ihw1ga
D Warning about Vultr Coupons
Heads up for anyone thinking about using Vultr with promotional credits—your experience might not be as smooth as expected.
I had $300 in promotional credits plus $5 I personally deposited (which I assumed was for identity verification), but I wasn’t able to use any of it.
First, they asked me to verify my profile, which I did. Then, out of nowhere, they demanded that I deposit another $50 just to access the funds I already had—effectively making my $300 in credits unusable. This requirement isn’t mentioned upfront, which is frustrating. If you're already committed to using Vultr, this might not be an issue, but if you just want to test the service, it feels weird.
To make things worse, you won’t necessarily be able to deploy your instances instantly. In many cases, you’ll need to open a support ticket and manually request access.
Their promotional credits and deposit policies are misleading, and once your money is in, you may not get it back. They don’t issue refunds. I couldn’t find any refund button on their website, and when I tried to request a refund through PayPal, they suspended my account immediately.
/r/MachineLearning
https://redd.it/1ihpz4k
Django Template LSP – For those not using PyCharm
For everyone not using PyCharm, I’ve built an LSP server for Django templates! After using it for a few months, I’m happy to release v1.0.0, and I think it works pretty well.
🔹 Autocomplete for {% load %}
, {% static %}
, {% url %}
, custom tags/filters and context variables.
🔹 Go-to definition for templates, views, and context variables.
🔹 Hover docs for {% url %}
and template tags/filters.
🔹 Works with Neovim, Helix, VS Code and others that support lsp's.
Check it out here: https://github.com/fourdigits/django-template-lsp Any feedback or suggestions? Open an issue on GitHub!
/r/django
https://redd.it/1igy8y3
D Why mamba disappeared?
I remember seeing mamba when it first came out and there was alot of hype around it because it was cheaper to compute than transformers and better performance
So why it disappeared like that ???
/r/MachineLearning
https://redd.it/1ihen9v
Is HTML e CSS enough for the frontend of a professional management application?
I'm developing an application for a bakery. It's a small management system. I have a lot of knowledge in backend with Flask, but little knowledge in frontend. I've done frontend projects using Bootstrap or Bulma CSS. But since I don't know much about React/Vue/Angular, I don't know what they could add to the project. What's your opinion about investing time and study in this? For those of you who work with Flask, how do you deal with the frontend part?
/r/flask
https://redd.it/1ij1ap0
django-allauth 65.4.0: headless improvements & misconceptions
A new release of django-allauth is available: version 65.4.0. It includes several headless improvements, most notably the ability to dynamically serve the API specification as well as out of the box integration with Django Ninja and Django REST framework.
The example (single-page application) running over at https://react.demo.allauth.org has been extended to showcase authentication using session cookies as well as tokens, and, integration with Django Ninja and Django REST framework.
I hope that clears up some of the misconceptions surrounding allauth.headless
, particularly these ones:
# I am building a mobile app and cannot use allauth, as it is using sessions!
Sessions shouldn't be confused with session cookies. You can have sessions without cookies. Authentication is an inherently stateful process. For example, allauth needs to know if a user is signed in, or not. Perhaps the user is partially signed in -- e.g. stuck in the 2FA stage, or pending an email verification code sent to the user by mail. Server side, allauth stores all of this in a regular Django session. Client side, if the client is operating in a browser, the session cookies point to this session as usual. If the client is an iOS/Android app, allauth hands out a session token which
/r/django
https://redd.it/1iiz9l2
Best approach for searching and filtering data?
Hello everyone,
I'm currently developing an Angular/Django application that heavily relies on searching and filtering data. I'm trying to determine the best approach for implementing these features efficiently. Here’s how the app needs to work:
1. Users will have access to an "advanced filtering" option with almost 50 different filters.
- Many of these filters are dropdowns representing the keys of related models.
- The remaining filters are text-based, allowing users to enter keywords or phrases.
For the text-based search filters, I need to be able to handle spelling errors and find matches even when the word order differs (e.g., "large, green, and heavy" vs. "heavy, green, and large"). Also, some text inputs will need to be searched across multiple columns.
2. The app will have two search modes: first one will return only the results that match 100% of the user's filters. The other mode will need to use a scoring system, ranking results by their relevance (e.g., 100% matches first, followed by 90%, 80%, etc.).
3. The table in question has around 3.000 records.
I would love some suggestions about how to implement this, will Django filters be enough? What would be the best way to handle the weighted search? Any recommendations on handling fuzzy search
/r/django
https://redd.it/1iik3xs
N How Deepseek trained their R1 models, and how frontier LLMs are trained today.
https://www.youtube.com/watch?v=aAfanTeRn84
Lex Friedman recently posted an interview called "DeepSeek's GPU Optimization tricks". It is a great behind the scenes look at how Deepseek trained their latest models even when they did not have as many GPUs and their American peers.
Necessity was the mother of invention and there are the few things that Deepseek did-
Their Mixture of experts configuration was innovative where they had a very high sparsity factor of 8/256 experts activating. This was much higher than in other models where 2 out of 8 experts activate.
Training this model can be hard because only a few experts actually learn for a task and are activated, making the models weak. They introduced an auxiliary loss to make sure all the experts are used across all tasks, leading to a strong model.
A challenge with mixture of experts model is that if only a few experts activate then only a few GPUs might be overloaded with compute while the rest sit idle. The auxiliary loss also prevents this from happening.
They went much further and implemented their own version of Nvidia's NCCL communications library and used a closer to assembly level PTX instructions to manage how SM's in the GPU
/r/MachineLearning
https://redd.it/1iii013
Django bugfix releases issued: 5.1.6, 5.0.12, and 4.2.19
https://www.djangoproject.com/weblog/2025/feb/05/bugfix-releases/
/r/django
https://redd.it/1iibgmu
Gunicorn doesn't find the package its in?
Hello, I'm trying to run my flask app with gunicorn.
When I run flask run
, it works, but when I rungunicorn app:app
it returns the following error:File "/home/user_name/Documents/project_name/backend/app.py", line 8, in <module>
from backend.backend2 import function1, function2, function3
ModuleNotFoundError: No module named 'backend'
My directory structure:
backend\\
\---backend2\\
\------... files
\---___init___.py
\---app.py
\---... other files
I run gunicorn from backend\\.
I have tried adding the absolute path to backend\\ to the python path but didn't work :/
Guinicorn is installed in a virtual env and I have activated.
Does anyone know how to fix this issue? Thanks
/r/flask
https://redd.it/1iigt04
fastplotlib, a new GPU-accelerated fast and interactive plotting library that leverages WGPU
What My Project Does
Fastplotlib is a next-gen plotting library that utilizes Vulkan, DX12, or Metal via WGPU, so it is very fast! We built this library for rapid prototyping and large-scale exploratory scientific visualization. This makes fastplotlib a great library for designing and developing machine learning models, especially in the realm of computer vision. Fastplotlib works in jupyterlab, Qt, and glfw, and also has optional imgui integration.
GitHub repo: https://github.com/fastplotlib/fastplotlib
Target audience:
Scientific visualization and production use.
Comparison:
Uses WGPU which is the next gen graphics stack, unlike most gpu accelerated libs that use opengl. We've tried very hard to make it easy to use for interactive plotting.
Our recent talk and examples gallery are a great way to get started!
Talk on youtube: https://www.youtube.com/watch?v=nmi-X6eU7Wo
Examples gallery: https://fastplotlib.org/ver/dev/gallery/index.html
As an aside, fastplotlib is not related to matplotlib in any way, we describe this in our FAQ: https://fastplotlib.org/ver/dev/userguide/faq.html#how-does-fastplotlib-relate-to-matplotlib
If you have any questions or would like to chat, feel free to reach out to us by posting a GitHub Issue or Discussion! We love engaging with our community!
/r/Python
https://redd.it/1iidlui
How to link to images in a subfolder of the templates folder?
I'm working on rebuilding my small blog in Flask. I currently have pages organized in year and date folders. So, all the specifics (html and images) for 2025-02-04 would be in /2025/0204/ . I'm looking to do the same in the templates folder in Flask.
How do I link to the images in the sub-sub-folder in the html? From what I know url_for() only looks in static for images.
/r/flask
https://redd.it/1ii3yej
How Rust is quietly taking over the Python ecosystem
Been noticing an interesting trend lately - Rust is becoming the secret sauce behind many of Python's most innovative tools. As someone who works with Python daily, it's fascinating to see how the ecosystem is evolving.
Here's what's caught my attention:
* **Ruff**: This linter is absurdly fast compared to traditional Python linters. Why? It's written in Rust. We're talking 10-100x speedups here.
* **PyOxidizer**: A solid solution for creating standalone Python applications. Again, Rust. (unfortunately not maintained anymore)
* **Polars**: This DataFrame library is giving Pandas a run for its money in terms of performance. Guess what? Rust under the hood.
* **Maturin**: Making it dead simple to create Python extensions in Rust.
My team has written a blog post diving deeper into this trend, specifically looking at PyO3 (the framework that makes Python/Rust integration possible) and showing how to build your own high-performance Python extensions with Rust. If you wish, you can read it here: [https://www.blueshoe.io/blog/python-rust-pyo3/](https://www.blueshoe.io/blog/python-rust-pyo3/)
The really interesting part is that most Python developers don't even realize they're using Rust-powered tools. It's like Rust is becoming Python's performance co-pilot without much fanfare.
What are your thoughts on this trend? Have you tried building any Python extensions with Rust?
*Full disclosure: Our team at Blueshoe wrote the
/r/Python
https://redd.it/1ii64gp
Python 3.13.2 Released
https://www.python.org/downloads/release/python-3132/
> Python 3.13 is the newest major release of the Python programming language, and it contains many new features and optimizations compared to Python 3.12. 3.13.2 is the latest maintenance release, containing almost 250 bugfixes, build improvements and documentation changes since 3.13.1.
It does not list precisely what bugs were fixed. Does anyone have a list?
/r/Python
https://redd.it/1ihsezp
Which hosting for a simple application?
I'm looking for hosting for an amateur project developed with Python3 + Flask. It's a simple application that will generate almost no traffic for most of the year, but on specific dates, it will be used by up to a few hundred people to access a page with data updated via WebSocket.
So, I'm looking for a provider that offers scalability when needed. I've already used AWS, but it might be "too much" for my needs.
/r/flask
https://redd.it/1ihhkgq
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/1ihwk3k
Need Suggestions
I have created a django-react app where user can read novels, bookmark etc(still not finished to me), already on a hackathon where developing a web app using django. Now my question is that To apply as a backend role what projects do I need more? Or is this enough?
What Do i need to showcase?
/r/djangolearning
https://redd.it/1igtt3x
Tach - A Python tool to enforce dependencies
Source: https://github.com/gauge-sh/tach
Python allows you to import and use anything, anywhere. Over time, this results in modules that were intended to be separate getting tightly coupled together, and domain boundaries breaking down.
We experienced this first-hand at a unicorn startup, where the entire engineering team paused development for over a year in an attempt to split up tightly coupled packages into independent microservices. This ultimately failed, and resulted in the CTO getting fired.
This problem occurs because:
It's much easier to add to an existing package rather than create a new one
Junior devs have a limited understanding of the existing architecture
External pressure leading to shortcuts and overlooking best practices
Attempts we've seen to fix this problem always came up short. A patchwork of solutions would attempt to solve this from different angles, such as developer education, CODEOWNERs, standard guides, refactors, and more. However, none of these addressed the root cause.
# What My Project Does
With [Tach](https://github.com/gauge-sh/tach), you can:
1. Declare your modules ([`tach mod`](https://docs.gauge.sh/usage/commands#tach-mod))
2. Automatically declare dependencies ([`tach sync`](https://docs.gauge.sh/usage/commands#tach-sync))
3. Enforce those dependencies ([`tach check`](https://docs.gauge.sh/usage/commands#tach-check))
4. Visualize those dependencies ([`tach show`](https://docs.gauge.sh/usage/commands#tach-show) and [`tach report`](https://docs.gauge.sh/usage/commands#tach-report))
You can also enforce a [public interface](https://docs.gauge.sh/usage/interfaces) for each module, and [deprecate dependencies](https://docs.gauge.sh/usage/deprecate) over time.
# Target Audience
Developers working on large Python monoliths
# Comparison
/r/Python
https://redd.it/1ihl5fy
A really specific situation with a page redirecting to itself in another language.
My website is available in english and pt-br, for that, I'm using the django.template.context_processors.i18ndjango
.
My settings look like this: LANGUAGE_CODE = 'en-us'
LANGUAGES = [ ('en', 'English'), ('pt-br', 'Português'), ]
TIME_ZONE = 'America/Sao_Paulo'
USE_I18N = True
USE_TZ = True
LOCALE_PATHS = [BASE_DIR / 'locale']
Everything works correctly, but I need the option for the user to switch languages and stay on the same page.
What I implemented is this form: <form action="{% url 'set_language' %}" method="post" class="sub-menu-content flow">
{% csrf_token %}
<fieldset onchange="this.form.submit()">
<label for="en-language-input">English</label>
<input type="radio" id="en-language-input" name="language" value="en" {% if LANGUAGE_CODE == 'en' %}checked{% endif %}>
<label for="pt-br-language-input">Português Brasileiro</label>
<input type="radio" id="pt-br-language-input" name="language" value="pt-br" {% if LANGUAGE_CODE == 'pt-br' %}checked{% endif %}>
</fieldset>
</form>
It also works fine, except when you access the website with an /en/ language prefix.
I tested it with brazilians and non-brazilians,
\- if you open the website without a language prefix, it will switch to default (en, or pt-br depending where you live) and the translation switch will work.
\- if you open the website with an /pt-br/ prefix, it will also work
\- if
/r/django
https://redd.it/1iheltr