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
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
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
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
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
Any convention on project structure?

Hey guys!

I've just started to implement an API service with Flask. I saw some project structures on the web. However, there is no consensus as far as I see if I am not wrong. Is there any Flask project directory structure by convention like Django?

Could you please share your suggestions for both a small project with a couple of models and endpoints and a larger project that needs different blueprints?

/r/flask
https://redd.it/1ijaa31
What kind of security are you implementing for your Django REST API application?

Hi, I am working on a project. I use Next.js for the frontend and Django for the backend. I use AWS for all the hosting. My question is: what kind of security measures are you using for the Django application? I am reading about OWASP; you can check the link here: OWASP website.

I use 'Ratelimit' for some of my forms.

https://preview.redd.it/acqw9878gkhe1.png?width=1078&format=png&auto=webp&s=6ef9b85ac21b425a0657b2d016742ad56000308d



/r/django
https://redd.it/1ijaaij
SEARCH YOUTUBE AND VIMEO IN ONE PLACE

# I just found this website that let you search for youtube and Vimeos videos, it rank the best videos from the two platforms based on views and quality of the content. It is cool because you search one place and get videos from two different platform

link: http://www.tubesynopsis.com

/r/django
https://redd.it/1ijnlte
Friday Daily Thread: r/Python Meta and Free-Talk Fridays

# Weekly Thread: Meta Discussions and Free Talk Friday 🎙️

Welcome to Free Talk Friday on /r/Python! This is the place to discuss the r/Python community (meta discussions), Python news, projects, or anything else Python-related!

## How it Works:

1. Open Mic: Share your thoughts, questions, or anything you'd like related to Python or the community.
2. Community Pulse: Discuss what you feel is working well or what could be improved in the /r/python community.
3. News & Updates: Keep up-to-date with the latest in Python and share any news you find interesting.

## Guidelines:

All topics should be related to Python or the /r/python community.
Be respectful and follow Reddit's Code of Conduct.

## Example Topics:

1. New Python Release: What do you think about the new features in Python 3.11?
2. Community Events: Any Python meetups or webinars coming up?
3. Learning Resources: Found a great Python tutorial? Share it here!
4. Job Market: How has Python impacted your career?
5. Hot Takes: Got a controversial Python opinion? Let's hear it!
6. Community Ideas: Something you'd like to see us do? tell us.

Let's keep the conversation going. Happy discussing! 🌟

/r/Python
https://redd.it/1ijhini
Any recommendations for an open source Flask repo using pytorch?

Hi, I'd like to play around with some open source Flask project that is using pytorch under the hood. I'm working on a build system and I'd like to test it out with apps that are huge packages like pytorch.



/r/flask
https://redd.it/1ijq279
DjangoMatrix.com - A project I've built in couple of weeks

Hey guys,

just wanted to share with you a project I've built with Django in the last couple of weeks.

The project is about being a one-stop-shop for everything related to Django packages, versioning, compatibilities etc.

You can find more detailed information on the r/Django post I've posted a while ago.

Given that it is open-source, you can scour trough the code and maybe get an "Aha!" moment.
(I'm not saying this is the perfect codebase (or project) I've built, but rather one that I've managed to build and deploy in very little time, and hoping if it gets some traction - we can do many, many improvements!)

p.s. All contributions are welcomed! Feel free to make a PR or report an Issue in the Github repository.

Check it out:
👉 DjangoMatrix.com
👉 GitHub Repository

/r/djangolearning
https://redd.it/1ij1t56
Seniors of django, how did learn the framework?

Hey everyone,

I’m 24 and trying to learn Django, but I’ve been struggling a lot. I have a background in computer engineering and some coding knowledge, but I lack job experience. Whenever I try to study or work on projects, I get tired quickly and lose focus. I also tend to underestimate my skills, which makes learning feel even harder.

On top of that, I feel really alone in this process. I don’t have a support system of people who understand what I’m going through, and I can’t use freelance platforms due to my location. All of this makes it hard to stay motivated, especially when I don’t see immediate progress.

I’m wondering if anyone has been in a similar situation. How do you push through when you feel isolated and discouraged? How do you deal with feeling like you’re not good enough, even when logically you know you’re making progress? Any tips for managing fatigue while studying?

I’d really appreciate any advice or encouragement. Thanks in advance!

P.s: I am interested in coding and developing.



/r/django
https://redd.it/1ijvisj
PyPy v7.3.18 release

>Here's the blog post about the PyPY 7.3.18 release that came out yesterday. Thanks to @matti-p.bsky.social, our release manager! This the first version with 3.11 support (beta only so far). Two cool other features in the thread below.

https://pypy.org/posts/2025/02/pypy-v7318-release.html

/r/Python
https://redd.it/1ijrewd
Handling Multiple Request of Streaming Responses for a Flask App?

Hi,

I'm using Flask for API end points. Front end is just a static site.
I'm currently just on the basic paid tier of pythonanywhere with 2 web workers.
For simple API calls, it is enough.

But currently, I'm implementing a chat gpt streaming completion which takes from 3 to 10 seconds.
With multiple requests, the third user will have to wait for the other user to finish, since there are only 2 web workers. And for the 4th user onwards, I think that would feel like an eternity lol


An obvious solution is to increase the web workers but I only have intermittent multiple request. I don't want to pay for multiple web workers that don't get used.

How do I go about this in pythonanywhere or should I just switch to a different provider? Can you recommend one that allows me to just use a web worker based on demand?

/r/flask
https://redd.it/1ijdfis
init() takes 1 positional argument but 3 were given

Someone Help please I don't know why my code is running on Juptyer

\# DASH Framework for Jupyter

from jupyter_dash import JupyterDash

from dash import dcc

from dash import html

from dash.dependencies import Input, Output

from pymongo import MongoClient

from bson.json_util import dumps

\# URL Lib to make sure that our input is 'sane'

import urllib.parse

\#TODO: import for your CRUD module

from aac_crud import AnimalShelter

\# Build App

app = JupyterDash("ModuleFive")

app.layout = html.Div([

\# This element generates an HTML Heading with your name

html.H1("Module 5 Asssignment - Stephanie Spraglin"),

\# This Input statement sets up an Input field for the username.

dcc.Input(

id="input_user".format("text"),

type="text",

placeholder="input type {}".format("text")),

\# This Input statement sets up an Input field for the password.

\# This designation masks the user input on the screen.

dcc.Input(

id="input_passwd".format("password"),

type="password",

placeholder="input type {}".format("password")),

\# Create a button labeled 'Submit'. When the button is pressed

\# the n_clicks value will increment by 1.

html.Button('Submit', id='submit-val', n_clicks=0),

\# Generate a horizontal line separating our input from our

\# output element

html.Hr(),

\# This sets up the output element for the dashboard. The

\# purpose of the stlye option is to make sure that the

\# output will function like a regular text area and accept

\# newline ('\\n') characters as line-breaks.

html.Div(id="query-out", style={'whiteSpace': 'pre-line'}),

\#TODO: insert unique identifier code here. Please Note:

\# when you insert another HTML element here, you will need to

\# add a comma to

/r/flask
https://redd.it/1ijja7g
Saturday Daily Thread: Resource Request and Sharing! Daily Thread

# Weekly Thread: Resource Request and Sharing 📚

Stumbled upon a useful Python resource? Or are you looking for a guide on a specific topic? Welcome to the Resource Request and Sharing thread!

## How it Works:

1. Request: Can't find a resource on a particular topic? Ask here!
2. Share: Found something useful? Share it with the community.
3. Review: Give or get opinions on Python resources you've used.

## Guidelines:

Please include the type of resource (e.g., book, video, article) and the topic.
Always be respectful when reviewing someone else's shared resource.

## Example Shares:

1. Book: "Fluent Python" \- Great for understanding Pythonic idioms.
2. Video: Python Data Structures \- Excellent overview of Python's built-in data structures.
3. Article: Understanding Python Decorators \- A deep dive into decorators.

## Example Requests:

1. Looking for: Video tutorials on web scraping with Python.
2. Need: Book recommendations for Python machine learning.

Share the knowledge, enrich the community. Happy learning! 🌟

/r/Python
https://redd.it/1ik9pae
Unable to understand flask

Im a beginner in computer science with some experience in pandas, matplotlib, scikit-learn and decided to learn backend.
I started a tutorial and finished it. Did the coding along with tutorial, but I couldn’t understanding why the things are happening like how is things being done under the hood like factory template, user authentication etc , especially flask-sqlalchemy.

I try to read documentation for any issue or thing i wanna implement and do. The sql-alchemy documentation is really shit and I can’t get anything out of it.
As for flask whatever i open has way too many things and everything goes side ways.

In the end i ask gpt to help me and teach me. And it kinda does work, and i understand a bit. But I don’t understand how the underlying things work.
Question is since I’ve completed the tutorial, how can i improve and learn flask very well and understand backend concepts deeply. I am thinking of doing this side by side along with my uni for next four months.

Should i just try to build different projects with the help of gpt or not. I can’t really understand.

/r/flask
https://redd.it/1ik44h2
Best way to get better at practical Python coding

I've noticed a trend in recent technical interviews - many are shifting towards project-based assessments where candidates need to build a mini working solution within 45 minutes.

While we have LeetCode for practicing algorithm problems, what's the best resource for practicing these types of practical coding challenges? Looking for platforms or resources that focus on building small, working applications under time pressure.

Any recommendation is much appreciated!

(Update: removed the website mentioned, not associated with it at all :) )

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