This site is run on a flask backend
https://cognity.space/
Optimized as much as I can. I'd like to hear your thoughts.
/r/flask
https://redd.it/1ncsuef
https://cognity.space/
Optimized as much as I can. I'd like to hear your thoughts.
/r/flask
https://redd.it/1ncsuef
How to deploy Flask and React+Vite web app - newbie
Hi! I've watched a lot of YT video tutorials on how to deploy and I'm still lost. Most of them are just quick demonstrations with one page and some are just hard to follow. My web app is developed using Flask for the backend and React+Vite for the frontend. Initially, the plan is to deploy the backend on Render and the frontend on Vercel but I saw a tutorial that you can bundle both so it only runs on one server although I can't follow the tutorial because mine has multiple pages and has no database (I tried to use In-memory). To be honest with ya'll, this is my first time doing web development and I had fun doing the project -- I just want to try it out and see it through from start to finish.
Any help is appreciated. Videos, articles,, github repos, or maybe a simple comment here but highly appreciate a step-by-step instructions because like I said just a newbie.
Thank you in advance!
/r/flask
https://redd.it/1ncfjua
Hi! I've watched a lot of YT video tutorials on how to deploy and I'm still lost. Most of them are just quick demonstrations with one page and some are just hard to follow. My web app is developed using Flask for the backend and React+Vite for the frontend. Initially, the plan is to deploy the backend on Render and the frontend on Vercel but I saw a tutorial that you can bundle both so it only runs on one server although I can't follow the tutorial because mine has multiple pages and has no database (I tried to use In-memory). To be honest with ya'll, this is my first time doing web development and I had fun doing the project -- I just want to try it out and see it through from start to finish.
Any help is appreciated. Videos, articles,, github repos, or maybe a simple comment here but highly appreciate a step-by-step instructions because like I said just a newbie.
Thank you in advance!
/r/flask
https://redd.it/1ncfjua
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
D SOTA modern alternative to BertScore?
Hi everyone,
I’m looking for an embedding-based metric to score text generation. BertScore is great, but it’s a bit outdated. Could you suggest some modern state-of-the-art alternatives?
/r/MachineLearning
https://redd.it/1ndaesz
Hi everyone,
I’m looking for an embedding-based metric to score text generation. BertScore is great, but it’s a bit outdated. Could you suggest some modern state-of-the-art alternatives?
/r/MachineLearning
https://redd.it/1ndaesz
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
I decoupled FastAPI dependency injection system in pure python, no dependencies.
What My Project Does
When building FastAPI endpoints, I found the dependency injection system such a pleasure to use that I wanted it everywhere, not just in my endpoints. I explored a few libraries that promised similar functionality, but each had drawbacks, some required Pydantic, others bundled in features beyond dependency injection, and many were riddled with bugs.
That's way I created PyDepends, a lightweight dependency injection system that I now use in my own projects and would like to share with you.
Target Audience
This is mainly aimed at:
FastAPI developers who want to use dependency injection in the service layer.
Domain-Driven Design practitioners who want to decouple their services from infrastructure.
Python developers who aren’t building API endpoints but would still like to use dependency injection in their projects.
It’s not production-grade yet, but it’s stable enough for everyday use and easy to extend.
Comparison
Compared to other similar packages, it does just that, inject dependencies, is not bloated with other functionalities.
FastDepends: I started out with this for another library I was using but had to ditch it because of the bugs. I even opened a pull request fixing the issue, but it wasn’t taken into account. It also
/r/Python
https://redd.it/1ndj5vz
What My Project Does
When building FastAPI endpoints, I found the dependency injection system such a pleasure to use that I wanted it everywhere, not just in my endpoints. I explored a few libraries that promised similar functionality, but each had drawbacks, some required Pydantic, others bundled in features beyond dependency injection, and many were riddled with bugs.
That's way I created PyDepends, a lightweight dependency injection system that I now use in my own projects and would like to share with you.
Target Audience
This is mainly aimed at:
FastAPI developers who want to use dependency injection in the service layer.
Domain-Driven Design practitioners who want to decouple their services from infrastructure.
Python developers who aren’t building API endpoints but would still like to use dependency injection in their projects.
It’s not production-grade yet, but it’s stable enough for everyday use and easy to extend.
Comparison
Compared to other similar packages, it does just that, inject dependencies, is not bloated with other functionalities.
FastDepends: I started out with this for another library I was using but had to ditch it because of the bugs. I even opened a pull request fixing the issue, but it wasn’t taken into account. It also
/r/Python
https://redd.it/1ndj5vz
GitHub
GitHub - entropy-flux/PyDepends: Dependency injection package for python.
Dependency injection package for python. Contribute to entropy-flux/PyDepends development by creating an account on GitHub.
A Complete List of Python Tkinter Colors, Valid and Tested
I needed a complete list of valid color names for Python's Tkinter package as part of my ButtonPad GUI framework development. The lists I found on the internet were either incomplete, buried under ads, and often just plain wrong. Here's a list of all 760 color names (valid and personally tested) for Python Tkinter.
https://inventwithpython.com/blog/complete-list-tkinter-colors-valid-and-tested.html
/r/Python
https://redd.it/1ndnusy
I needed a complete list of valid color names for Python's Tkinter package as part of my ButtonPad GUI framework development. The lists I found on the internet were either incomplete, buried under ads, and often just plain wrong. Here's a list of all 760 color names (valid and personally tested) for Python Tkinter.
https://inventwithpython.com/blog/complete-list-tkinter-colors-valid-and-tested.html
/r/Python
https://redd.it/1ndnusy
PyPI
ButtonPad
A simple Tkinter-based GUI framework for making a grid of buttons, text boxes, and labels.
Manager wants me to present a “deep dive” learning module for Django
So I’ve recently started to learn and work with Django and I’ve learned enough to get by and work on features.
But now my manager wants me to dive in and present more in depth concepts of Django that my peers can learn from, I’d appreciate some articles or resources that are outside the surface level documentation that I’ve read upon.
This is what he has written in my goals sheet:
“Complete a deep-dive learning module on Django internals or system-level design”
Any help/guidance will be appreciated!
/r/django
https://redd.it/1ndghdj
So I’ve recently started to learn and work with Django and I’ve learned enough to get by and work on features.
But now my manager wants me to dive in and present more in depth concepts of Django that my peers can learn from, I’d appreciate some articles or resources that are outside the surface level documentation that I’ve read upon.
This is what he has written in my goals sheet:
“Complete a deep-dive learning module on Django internals or system-level design”
Any help/guidance will be appreciated!
/r/django
https://redd.it/1ndghdj
Reddit
From the django community on Reddit
Explore this post and more from the django community
Flask-React: Server-Side React Component Rendering Extension
I'd like to share a Flask extension I've been working on that brings server-side React component rendering to Flask applications with template-like functionality.
**Flask-React** is a Flask extension that enables you to render React components on the server-side using Node.js, providing a bridge between Flask's backend capabilities and React's component-based frontend approach. It works similarly to Jinja2 templates but uses React components instead.
### Key Features
- **Server-side React rendering** using Node.js subprocess for reliable performance
- **Template-like integration** with Flask routes - pass props like template variables
- **Jinja2 template compatibility** - use React components within existing Jinja2 templates
- **Component caching** for production performance optimization
- **Hot reloading** in development mode with automatic cache invalidation
- **Multiple file format support** (.jsx, .js, .ts, .tsx)
- **CLI tools** for component generation and management
### Quick Example
```python
from flask import Flask
from flask_react import FlaskReact
app = Flask(__name__)
react = FlaskReact(app)
@app.route('/user/<int:user_id>')
def user_profile(user_id):
user = get_user(user_id)
return react.render_template('UserProfile',
user=user,
current_user=g.current_user,
can_edit=user_id == g.current_user.id
)
```
```jsx
// components/UserProfile.jsx
function UserProfile({ user, current_user, can_edit }) {
return (
<div>
/r/flask
https://redd.it/1ndrhnk
I'd like to share a Flask extension I've been working on that brings server-side React component rendering to Flask applications with template-like functionality.
**Flask-React** is a Flask extension that enables you to render React components on the server-side using Node.js, providing a bridge between Flask's backend capabilities and React's component-based frontend approach. It works similarly to Jinja2 templates but uses React components instead.
### Key Features
- **Server-side React rendering** using Node.js subprocess for reliable performance
- **Template-like integration** with Flask routes - pass props like template variables
- **Jinja2 template compatibility** - use React components within existing Jinja2 templates
- **Component caching** for production performance optimization
- **Hot reloading** in development mode with automatic cache invalidation
- **Multiple file format support** (.jsx, .js, .ts, .tsx)
- **CLI tools** for component generation and management
### Quick Example
```python
from flask import Flask
from flask_react import FlaskReact
app = Flask(__name__)
react = FlaskReact(app)
@app.route('/user/<int:user_id>')
def user_profile(user_id):
user = get_user(user_id)
return react.render_template('UserProfile',
user=user,
current_user=g.current_user,
can_edit=user_id == g.current_user.id
)
```
```jsx
// components/UserProfile.jsx
function UserProfile({ user, current_user, can_edit }) {
return (
<div>
/r/flask
https://redd.it/1ndrhnk
Reddit
From the flask community on Reddit: Flask-React: Server-Side React Component Rendering Extension
Explore this post and more from the flask community
Confused in queryset
Well I am new in django... And learning about queryset..... But don't know how the relationship and access field is working....
Kindly provide some blogs , links
/r/djangolearning
https://redd.it/1ndhcuq
Well I am new in django... And learning about queryset..... But don't know how the relationship and access field is working....
Kindly provide some blogs , links
/r/djangolearning
https://redd.it/1ndhcuq
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
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/1ndua5j
# 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/1ndua5j
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Streamlit for python apps
i’ve been using streamlit lately and honestly it’s pretty nice, so just wanted to share in case it helps someone.
if you’re into data analysis or working on python projects and want to turn them into something interactive, streamlit is definitely worth checking out. it lets you build web apps super easily — like you just write python code and it handles all the front-end stuff for you.
you can add charts, sliders, forms, even upload files, and it all works without needing to learn html or javascript. really useful if you want to share your work with others or just make a personal dashboard or tool.
feels like a good starting point if you’ve been thinking about making web apps but didn’t know where to start.
/r/Python
https://redd.it/1ndsuud
i’ve been using streamlit lately and honestly it’s pretty nice, so just wanted to share in case it helps someone.
if you’re into data analysis or working on python projects and want to turn them into something interactive, streamlit is definitely worth checking out. it lets you build web apps super easily — like you just write python code and it handles all the front-end stuff for you.
you can add charts, sliders, forms, even upload files, and it all works without needing to learn html or javascript. really useful if you want to share your work with others or just make a personal dashboard or tool.
feels like a good starting point if you’ve been thinking about making web apps but didn’t know where to start.
/r/Python
https://redd.it/1ndsuud
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
[video] Add Agents to your Web Applications with Pydantic AI and Django
https://www.youtube.com/watch?v=Z33IBfgVbxI
/r/django
https://redd.it/1ne0vyv
https://www.youtube.com/watch?v=Z33IBfgVbxI
/r/django
https://redd.it/1ne0vyv
YouTube
Pydantic AI and Django: Add Agents to your Web Applications
This video gives an overview of Pydantic AI and shows how you can use it to add agentic functionality to your web applications.
Pydantic AI: https://ai.pydantic.dev/
SaaS Pegasus: https://www.saaspegasus.com/
Weather agent demo (requires login): https:/…
Pydantic AI: https://ai.pydantic.dev/
SaaS Pegasus: https://www.saaspegasus.com/
Weather agent demo (requires login): https:/…
Python VS Power BI
Why use python (streamlit =(easy but limited), dash=(complex)) for data visualization when there is power bi and tableau ?
/r/Python
https://redd.it/1ne2g15
Why use python (streamlit =(easy but limited), dash=(complex)) for data visualization when there is power bi and tableau ?
/r/Python
https://redd.it/1ne2g15
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Need help for integrating python model to mern stack project
Hello, I am building a ai therapist as my college project and for that I want to integrate python sentiment analysis model into my application.The idea of my webapp is that users can ask a therapy query to ai and the sentiment analysis model will identify the user sentiment and sent the query to gpt model which will then send the response back in chat.Can someone please guide me on the integration.
/r/flask
https://redd.it/1ndbvqa
Hello, I am building a ai therapist as my college project and for that I want to integrate python sentiment analysis model into my application.The idea of my webapp is that users can ask a therapy query to ai and the sentiment analysis model will identify the user sentiment and sent the query to gpt model which will then send the response back in chat.Can someone please guide me on the integration.
/r/flask
https://redd.it/1ndbvqa
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
How to use JWT tokens stored in cookies for evey API requests
I'm using Django template and htmx for the frontend. I'm facing an issue of getting the tokens stored in the cookies to the API. The cookies are stored, but the API doesn't get them. I checked the internet, but I couldn't find one that explains it.
class CustomTokenObtainApiView(TokenObtainPairView):
def post(self, request, *args, **kwargs):
serializer = self.get_serializer(data = request.data)
serializer.is_valid(raise_exception = True)
tokens = serializer.validated_data
response = Response({'details': 'login successful'})
response.set_cookie(
'access_token', tokens['access'], httponly=True, secure=False, samesite='lax'
)
response.set_cookie(
'refresh_token', tokens['refresh'], httponly=True, secure=False, samesite='lax'
)
response["HX-Redirect"] = "/homepage/"
return response
Here
/r/django
https://redd.it/1ne37xz
I'm using Django template and htmx for the frontend. I'm facing an issue of getting the tokens stored in the cookies to the API. The cookies are stored, but the API doesn't get them. I checked the internet, but I couldn't find one that explains it.
class CustomTokenObtainApiView(TokenObtainPairView):
def post(self, request, *args, **kwargs):
serializer = self.get_serializer(data = request.data)
serializer.is_valid(raise_exception = True)
tokens = serializer.validated_data
response = Response({'details': 'login successful'})
response.set_cookie(
'access_token', tokens['access'], httponly=True, secure=False, samesite='lax'
)
response.set_cookie(
'refresh_token', tokens['refresh'], httponly=True, secure=False, samesite='lax'
)
response["HX-Redirect"] = "/homepage/"
return response
Here
/r/django
https://redd.it/1ne37xz
Reddit
From the django community on Reddit
Explore this post and more from the django community
detroit: Python implementation of d3js
Hi, I am the maintainer of detroit.
You can find the documentation for
Target Audience
`detroit` allows you to create static data visualizations. I'm currently working on [detroit-live](https://github.com/bourbonut/detroit-live) for those who also want interactivity. In addition, `detroit` requires only [lxml](https://lxml.de/) as dependency, which makes it lightweight.
You can find a gallery of examples in the [documentation](https://detroit.readthedocs.io/en/latest/#gallery). Most of examples are directly inspired by [d3js examples on observablehq](https://observablehq.com/@d3/gallery).
Comparison
The API is almost the same:
// d3js
const scale = d3.scaleLinear().domain(0, 10).range(0, 920);
console.log(scale.domain()) // 0, 10
# detroit
scale = d3.scalelinear().setdomain(0, 10).setrange([0, 920])
print(scale.getdomain()) # 0, 10
The difference between
/r/Python
https://redd.it/1ne4t1d
Hi, I am the maintainer of detroit.
detroit is a Python implementation of the library d3js. I started this project because I like how flexible data visualization is with d3js, and because I'm not a big fan of JavaScript.You can find the documentation for
detroit here.Target Audience
`detroit` allows you to create static data visualizations. I'm currently working on [detroit-live](https://github.com/bourbonut/detroit-live) for those who also want interactivity. In addition, `detroit` requires only [lxml](https://lxml.de/) as dependency, which makes it lightweight.
You can find a gallery of examples in the [documentation](https://detroit.readthedocs.io/en/latest/#gallery). Most of examples are directly inspired by [d3js examples on observablehq](https://observablehq.com/@d3/gallery).
Comparison
The API is almost the same:
// d3js
const scale = d3.scaleLinear().domain(0, 10).range(0, 920);
console.log(scale.domain()) // 0, 10
# detroit
scale = d3.scalelinear().setdomain(0, 10).setrange([0, 920])
print(scale.getdomain()) # 0, 10
The difference between
d3js/detroit and matplotlib/plotly/seaborn is the approach to data visualization. With matplotlib, plotly, or seaborn, you only need to write a few lines and that's it - you get your visualization. However, if you want to customize some parts, you'll have to add a couple more lines, and it can/r/Python
https://redd.it/1ne4t1d
GitHub
GitHub - bourbonut/detroit: detroit is a Python implementation of d3js
detroit is a Python implementation of d3js. Contribute to bourbonut/detroit development by creating an account on GitHub.
DNVIDIA Blackwell Ultra crushes MLPerf
NVIDIA dropped MLPerf results for Blackwell Ultra yesterday. 5× throughput on DeepSeek-R1, record runs on Llama 3.1 and Whisper, plus some clever tricks like FP8 KV-cache and disaggregated serving. The raw numbers are insane.
But I wonder though . If these benchmark wins actually translate into lower real-world inference costs.
In practice, workloads are bursty. GPUs sit idle, batching only helps if you have steady traffic, and orchestration across models is messy. You can have the fastest chip in the world, but if 70% of the time it’s underutilized, the economics don’t look so great to me. IMO
/r/MachineLearning
https://redd.it/1ndo5md
NVIDIA dropped MLPerf results for Blackwell Ultra yesterday. 5× throughput on DeepSeek-R1, record runs on Llama 3.1 and Whisper, plus some clever tricks like FP8 KV-cache and disaggregated serving. The raw numbers are insane.
But I wonder though . If these benchmark wins actually translate into lower real-world inference costs.
In practice, workloads are bursty. GPUs sit idle, batching only helps if you have steady traffic, and orchestration across models is messy. You can have the fastest chip in the world, but if 70% of the time it’s underutilized, the economics don’t look so great to me. IMO
/r/MachineLearning
https://redd.it/1ndo5md
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
Django REST Framework: request.version is unknown
👋 Hi everyone,
I’m working on a project using Django REST Framework and I’m trying to switch serializers depending on the API version. My ViewSet looks like this:
But when I run this, I get an error saying that the attribute version is unknown (or None).
How can I fix this so that versioning works correctly and the serializer changes based on the version?
Thanks!
/r/django
https://redd.it/1ndw8pl
👋 Hi everyone,
I’m working on a project using Django REST Framework and I’m trying to switch serializers depending on the API version. My ViewSet looks like this:
class EstudanteViewSet(viewsets.ModelViewSet):queryset = Estudante.objects.all()filter_backends = [DjangoFilterBackend, filters.OrderingFilter, filters.SearchFilter]ordering_fields = ['nome']search_fields = ['nome', 'cpf']def get_serializer_class(self):if self.request.version == 'v2': # the problem is in the "version"return EstudanteSerializerV2return EstudanteSerializerBut when I run this, I get an error saying that the attribute version is unknown (or None).
How can I fix this so that versioning works correctly and the serializer changes based on the version?
Thanks!
/r/django
https://redd.it/1ndw8pl
Reddit
From the django community on Reddit
Explore this post and more from the django community
Cant use flask run for some reason
I've been trying to run flask in vscode for a while now but I can't get it to work. The error message i get is:
Try 'flask run --help' for help.
Error: Failed to find Flask application or factory in module 'app'. Use 'app:name' to specify one.
I've tried everything. Running export and checking my code for any mistakes but flask run just doesnt work. What do yall suggest
/r/flask
https://redd.it/1ncis3e
I've been trying to run flask in vscode for a while now but I can't get it to work. The error message i get is:
Try 'flask run --help' for help.
Error: Failed to find Flask application or factory in module 'app'. Use 'app:name' to specify one.
I've tried everything. Running export and checking my code for any mistakes but flask run just doesnt work. What do yall suggest
/r/flask
https://redd.it/1ncis3e
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
How to Build Your Own Bluetooth Scriptable Sniffer using python for Under $25
A Bluetooth sniffer is a hardware or software tool that captures and monitors Bluetooth communication between devices. Think of it as a network traffic analyzer, but for Bluetooth instead of Wi-Fi or Ethernet.
There are high-end Bluetooth sniffers on the market — like those from Ellisys or Teledyne LeCroy — which are powerful but often cost hundreds or thousands of dollars.
You can create your own scriptable BLE sniffer for under $25. the source code is available in this post, you can adjust the code and work further
https://www.bleuio.com/blog/how-to-build-your-own-bluetooth-scriptable-sniffer-for-under-30/
/r/Python
https://redd.it/1ne4z4b
A Bluetooth sniffer is a hardware or software tool that captures and monitors Bluetooth communication between devices. Think of it as a network traffic analyzer, but for Bluetooth instead of Wi-Fi or Ethernet.
There are high-end Bluetooth sniffers on the market — like those from Ellisys or Teledyne LeCroy — which are powerful but often cost hundreds or thousands of dollars.
You can create your own scriptable BLE sniffer for under $25. the source code is available in this post, you can adjust the code and work further
https://www.bleuio.com/blog/how-to-build-your-own-bluetooth-scriptable-sniffer-for-under-30/
/r/Python
https://redd.it/1ne4z4b
BleuIO - Create Bluetooth Low Energy application
How to Build Your Own Bluetooth Scriptable Sniffer for Under $30 - BleuIO - Create Bluetooth Low Energy application
Bluetooth is commonly used in many products — from smartwatches and fitness trackers to wireless speakers, beacons, air quality sensors, and beyond. As developers, engineers, or even curious tech enthusiasts, we often would like to analyze what is being transmitted…
Recommend a good email digest about django
Can someone recommend a good programming digest focused on django, drf? Substack, behive or similar, with interesting topics and good curation.
/r/django
https://redd.it/1neat6h
Can someone recommend a good programming digest focused on django, drf? Substack, behive or similar, with interesting topics and good curation.
/r/django
https://redd.it/1neat6h
Reddit
From the django community on Reddit
Explore this post and more from the django community