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
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
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
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
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
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
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
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
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 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
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
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
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:appit 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
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
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
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
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
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
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
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