Tuesday Daily Thread: Advanced questions
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1otue4f
# Weekly Wednesday Thread: Advanced Questions 🐍
Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.
## How it Works:
1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.
## Guidelines:
* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.
## Recommended Resources:
* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.
## Example Questions:
1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the
/r/Python
https://redd.it/1otue4f
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
I just published my first ever Python library on PyPI....
After days of experimenting, and debugging, I’ve officially released numeth - a library focused on core Numerical Methods used in engineering and applied mathematics.
- What My Project Does
Numeth helps you quickly solve tough mathematical problems - like equations, integration, and differentiation - using accurate and efficient numerical methods.
It covers essential methods like:
1. Root finding (Newton–Raphson, Bisection, etc.)
2. Numerical integration and differentiation
3. Interpolation, optimization, and linear algebra
- Target Audience
I built this from scratch with a single goal:
Make fundamental numerical algorithms ready to use for students and developers alike.
- Comparison
Most Python libraries, like NumPy and SciPy, are designed to use numerical methods, not understand them. Their implementations are optimized in C or Fortran, which makes them incredibly fast but opaque to anyone trying to learn how these algorithms actually work.
'numeth' takes a completely different approach.
It reimplements the core algorithms of numerical computing in pure, readable Python, structured into clear, modular functions.
The goal isn’t raw performance. It’s helping students, educators, and developers trace each computation step by step, experiment with the logic, and build a stronger mathematical intuition before diving into heavier frameworks.
If you’re into numerical computing or just curious to see what it’s about, you can check it out here:
🔗 https://pypi.org/project/numeth/
or run 'pip
/r/Python
https://redd.it/1otjuu4
After days of experimenting, and debugging, I’ve officially released numeth - a library focused on core Numerical Methods used in engineering and applied mathematics.
- What My Project Does
Numeth helps you quickly solve tough mathematical problems - like equations, integration, and differentiation - using accurate and efficient numerical methods.
It covers essential methods like:
1. Root finding (Newton–Raphson, Bisection, etc.)
2. Numerical integration and differentiation
3. Interpolation, optimization, and linear algebra
- Target Audience
I built this from scratch with a single goal:
Make fundamental numerical algorithms ready to use for students and developers alike.
- Comparison
Most Python libraries, like NumPy and SciPy, are designed to use numerical methods, not understand them. Their implementations are optimized in C or Fortran, which makes them incredibly fast but opaque to anyone trying to learn how these algorithms actually work.
'numeth' takes a completely different approach.
It reimplements the core algorithms of numerical computing in pure, readable Python, structured into clear, modular functions.
The goal isn’t raw performance. It’s helping students, educators, and developers trace each computation step by step, experiment with the logic, and build a stronger mathematical intuition before diving into heavier frameworks.
If you’re into numerical computing or just curious to see what it’s about, you can check it out here:
🔗 https://pypi.org/project/numeth/
or run 'pip
/r/Python
https://redd.it/1otjuu4
PyPI
numeth
A set of core numerical methods used in engineering and applied mathematics
R Open-dLLM: Open Diffusion Large Language Models
the most open release of a diffusion-based large language model to date —
including pretraining, evaluation, inference, and checkpoints.
code: https://github.com/pengzhangzhi/Open-dLLM
/r/MachineLearning
https://redd.it/1otpj7v
the most open release of a diffusion-based large language model to date —
including pretraining, evaluation, inference, and checkpoints.
code: https://github.com/pengzhangzhi/Open-dLLM
/r/MachineLearning
https://redd.it/1otpj7v
GitHub
GitHub - pengzhangzhi/Open-dLLM: The most open diffusion language model for code generation — releasing pretraining, evaluation…
The most open diffusion language model for code generation — releasing pretraining, evaluation, inference, and checkpoints. - pengzhangzhi/Open-dLLM
Django Roadmap (Web Dev)
Is there a site or something, where I can a roadmap? I prefer something like this so I know what to learn after the other. Thank you!
/r/djangolearning
https://redd.it/1opp3jz
Is there a site or something, where I can a roadmap? I prefer something like this so I know what to learn after the other. Thank you!
/r/djangolearning
https://redd.it/1opp3jz
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Django Rich Text with i18n
Hi all.
Right now I am building my personal multi language blog website, with Django as Backend.
I am actively looking for something like RichText in Rails for posts, but as for now with no luck.
What I need is minimalistic text editor with Bold, Italic, maybe list options AND important thing - feature to add picture in the text with captions below these pictures.
There will be only one author -- me =)
So, nothing special on top of that. Simple is better.
I am fairly new to Django, so right now I am somewhat confused -- there are things like CKeditor, but they are expensive, and to be honest -- there is no clear way how to setup them with i18n.
Do you have any suggestions what should I look for, preferably easy to setup and use?
Many thanks in advance!
/r/django
https://redd.it/1ottmbd
Hi all.
Right now I am building my personal multi language blog website, with Django as Backend.
I am actively looking for something like RichText in Rails for posts, but as for now with no luck.
What I need is minimalistic text editor with Bold, Italic, maybe list options AND important thing - feature to add picture in the text with captions below these pictures.
There will be only one author -- me =)
So, nothing special on top of that. Simple is better.
I am fairly new to Django, so right now I am somewhat confused -- there are things like CKeditor, but they are expensive, and to be honest -- there is no clear way how to setup them with i18n.
Do you have any suggestions what should I look for, preferably easy to setup and use?
Many thanks in advance!
/r/django
https://redd.it/1ottmbd
Reddit
From the django community on Reddit
Explore this post and more from the django community
D Choosing a thesis topic in ML
I am at the stage where I have to decide my undergraduate thesis problem statement to work on in the next semester. To those who've had their undergraduate/master's thesis in ML, how did you decide to work on that statement?
Did you start by looking at datasets first and then build your problem around it? Or did you look at existing problems in some framework and try to fix them? Or did you just let your academic guide give you a statement? Or something entirely different?
I'm more inclined towards Computer Vision but open to other ML fields as well, so any suggestions on how to look for a problem statement are most welcome.
Thanks!
/r/MachineLearning
https://redd.it/1ou2s9x
I am at the stage where I have to decide my undergraduate thesis problem statement to work on in the next semester. To those who've had their undergraduate/master's thesis in ML, how did you decide to work on that statement?
Did you start by looking at datasets first and then build your problem around it? Or did you look at existing problems in some framework and try to fix them? Or did you just let your academic guide give you a statement? Or something entirely different?
I'm more inclined towards Computer Vision but open to other ML fields as well, so any suggestions on how to look for a problem statement are most welcome.
Thanks!
/r/MachineLearning
https://redd.it/1ou2s9x
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
Migrating django heroku to vps
I have an ecom website whose server is hosted on heroku. Django server on web dyno + celery on worker dyno+ meilisearch on another dyno.
As the traffic grew, it now requires Standard 1X for dynos which is like 25 usd per dynos.
I wanted to migrate to some good VPS. Any recommendations like Hostingers Vps is cheap.
/r/django
https://redd.it/1otzz23
I have an ecom website whose server is hosted on heroku. Django server on web dyno + celery on worker dyno+ meilisearch on another dyno.
As the traffic grew, it now requires Standard 1X for dynos which is like 25 usd per dynos.
I wanted to migrate to some good VPS. Any recommendations like Hostingers Vps is cheap.
/r/django
https://redd.it/1otzz23
Reddit
From the django community on Reddit
Explore this post and more from the django community
A collection of type-safe, async friendly, and unopinionated enhancements to SQLAlchemy Core
Project link: https://github.com/sayanarijit/sqla-fancy-core
## Why?
- ORMs are magical, but it's not always a feature. Sometimes, we crave for familiar.
- SQLAlchemy Core is powerful but
- The idea of sessions can feel too magical and opinionated. This library removes the magic and opinions and takes you to back to familiar transactions's territory, providing multiple un-opinionated APIs to deal with it. See Wrappers and Decorators.
## Demos:
- FastAPI - sqla-fancy-core example app.
## Target audience
Production. For folks who prefer query maker over ORM, looking for a robust sync/async driver integration, wanting to keep code readable and secure.
## Comparison with other projects:
Peewee: No type hints. Also, no official async support.
Piccolo: Tight integration with drivers. Very opinionated. Not as flexible or mature as sqlalchemy core.
Pypika: Doesn’t prevent sql injection by default. Hence, can be considered insecure.
/r/Python
https://redd.it/1otx8aa
Project link: https://github.com/sayanarijit/sqla-fancy-core
## Why?
- ORMs are magical, but it's not always a feature. Sometimes, we crave for familiar.
- SQLAlchemy Core is powerful but
table.c.column breaks static type checking and has runtime overhead. This library provides a better way to define tables while keeping all of SQLAlchemy's flexibility. See Table Factory.- The idea of sessions can feel too magical and opinionated. This library removes the magic and opinions and takes you to back to familiar transactions's territory, providing multiple un-opinionated APIs to deal with it. See Wrappers and Decorators.
## Demos:
- FastAPI - sqla-fancy-core example app.
## Target audience
Production. For folks who prefer query maker over ORM, looking for a robust sync/async driver integration, wanting to keep code readable and secure.
## Comparison with other projects:
Peewee: No type hints. Also, no official async support.
Piccolo: Tight integration with drivers. Very opinionated. Not as flexible or mature as sqlalchemy core.
Pypika: Doesn’t prevent sql injection by default. Hence, can be considered insecure.
/r/Python
https://redd.it/1otx8aa
GitHub
GitHub - sayanarijit/sqla-fancy-core: A collection of type-safe, async friendly, and un-opinionated enhancements to SQLAlchemy…
A collection of type-safe, async friendly, and un-opinionated enhancements to SQLAlchemy Core that works well with mordern web servers - sayanarijit/sqla-fancy-core
Can't get Flask-JWT-Extended to set cookies with token properly (help appreciated)
Hi, y'all!
I am struggling with a semi-private project with JWT authentication.
This is the flask login route:
@bp.route("/auth/login", methods="POST")
@crossorigin(
origins=["http://localhost:5173"],
supportscredentials=True,
)
def login():
loginusername = request.json.get("username", None)
loginpassword = request.json.get("password", None)
dbuser = User.query.filterby(email=loginusername).oneornone()
if not dbuser or not dbuser.checkpassword(loginpassword):
app.logger.warning(f"Failed login attempt for {loginusername}")
return jsonify({"error": "Invalid credentials"}), 401
response = jsonify(
{
"msg": "login successful",
"userdata": {
/r/flask
https://redd.it/1ou730g
Hi, y'all!
I am struggling with a semi-private project with JWT authentication.
This is the flask login route:
@bp.route("/auth/login", methods="POST")
@crossorigin(
origins=["http://localhost:5173"],
supportscredentials=True,
)
def login():
loginusername = request.json.get("username", None)
loginpassword = request.json.get("password", None)
dbuser = User.query.filterby(email=loginusername).oneornone()
if not dbuser or not dbuser.checkpassword(loginpassword):
app.logger.warning(f"Failed login attempt for {loginusername}")
return jsonify({"error": "Invalid credentials"}), 401
response = jsonify(
{
"msg": "login successful",
"userdata": {
/r/flask
https://redd.it/1ou730g
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Need help don't know what to do
I need to learn a basic level of Django and
Don't know what source to follow I have a project to be done by next 45days
Please can anyone share me a course on udemy or something 😭
/r/djangolearning
https://redd.it/1ouflpy
I need to learn a basic level of Django and
Don't know what source to follow I have a project to be done by next 45days
Please can anyone share me a course on udemy or something 😭
/r/djangolearning
https://redd.it/1ouflpy
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
Decorators are great!
After a long, long time trying to wrap my head around decorators, I am using them more and more. I'm not suggesting I fully grasp metaprogramming in principle, but I'm really digging on decorators, and I'm finding them especially useful with UI callbacks.
I know a lot of folks don't like using decorators; for me, they've always been difficult to understand. Do you use decorators? If you understand how they work but don't, why not?
/r/Python
https://redd.it/1oubbk3
After a long, long time trying to wrap my head around decorators, I am using them more and more. I'm not suggesting I fully grasp metaprogramming in principle, but I'm really digging on decorators, and I'm finding them especially useful with UI callbacks.
I know a lot of folks don't like using decorators; for me, they've always been difficult to understand. Do you use decorators? If you understand how they work but don't, why not?
/r/Python
https://redd.it/1oubbk3
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
I need help with calculated fields.
I've done a lot of research, but I'm currently overwhelmed. The calculations I need to do are actually simple, such as: how many units of a product are in stock, how many orders exist for that product, or how many items were shipped in an order and how many are remaining. I'm developing an app that handles these calculations, but I'm unsure of the best way to implement these calculated fields. Should I use
/r/django
https://redd.it/1oub9fl
I've done a lot of research, but I'm currently overwhelmed. The calculations I need to do are actually simple, such as: how many units of a product are in stock, how many orders exist for that product, or how many items were shipped in an order and how many are remaining. I'm developing an app that handles these calculations, but I'm unsure of the best way to implement these calculated fields. Should I use
property, signals, or another method? I feel overwhelmed and lost. I would really appreciate it if you could explain the logic behind this and the correct approach, or provide some example code for similar operations./r/django
https://redd.it/1oub9fl
Reddit
From the django community on Reddit
Explore this post and more from the django community
Handling Shared Django Libs? Requirements / Cloning / Submodule / Subtree - What do you do?
I've got a couple shared 'apps', that I share among most Django projects I write (but not all). They are both private repos, so they require ssh to clone down.
One handles some auth related stuff (and holds some templating stuff)
One handles things related to another database (models for the most part)
I've gone over this about a dozen times trying to figure out the "best" way to incorporate those apps into various projects.
I'm curious what the community has to say about it, or what ideas you guys might have for how you handle things like this. I figure there are 4 main options:
1. Include it in requirements (how I currently do things)
Make it an installable lib and just put it in your projects requirements.
It works but it's a pain in the rear anytime you want to update / change the external lib. There are additional hoops you have to jump through in order to do it that are kind of clunky/painful.
2. Clone the repo into the project (how I previously did things)
Just clone your project, then clone in the repo.
It's nice because you can just
/r/django
https://redd.it/1oton6p
I've got a couple shared 'apps', that I share among most Django projects I write (but not all). They are both private repos, so they require ssh to clone down.
One handles some auth related stuff (and holds some templating stuff)
One handles things related to another database (models for the most part)
I've gone over this about a dozen times trying to figure out the "best" way to incorporate those apps into various projects.
I'm curious what the community has to say about it, or what ideas you guys might have for how you handle things like this. I figure there are 4 main options:
1. Include it in requirements (how I currently do things)
Make it an installable lib and just put it in your projects requirements.
It works but it's a pain in the rear anytime you want to update / change the external lib. There are additional hoops you have to jump through in order to do it that are kind of clunky/painful.
2. Clone the repo into the project (how I previously did things)
Just clone your project, then clone in the repo.
It's nice because you can just
/r/django
https://redd.it/1oton6p
Reddit
From the django community on Reddit
Explore this post and more from the django community
A Python 2.7 to 3.14 conversion. Existential angst.
A bit of very large technical debt has just reached its balloon payment.
An absolutely 100% mission-critical, it's-where-the-money-comes-in Django backend is still on Python 2.7, and that's become unacceptable. It falls to me to convert it to running on Python 3.14 (along with the various package upgrades required).
At last count, it's about 32,000 lines of code.
I know much of what I must do, but I am looking for any suggestions to help make the process somewhat less painful. Anyone been through this kind of conversion have any interesting tips? (I know it's going to be painful, but the less the better.)
/r/Python
https://redd.it/1ouihlq
A bit of very large technical debt has just reached its balloon payment.
An absolutely 100% mission-critical, it's-where-the-money-comes-in Django backend is still on Python 2.7, and that's become unacceptable. It falls to me to convert it to running on Python 3.14 (along with the various package upgrades required).
At last count, it's about 32,000 lines of code.
I know much of what I must do, but I am looking for any suggestions to help make the process somewhat less painful. Anyone been through this kind of conversion have any interesting tips? (I know it's going to be painful, but the less the better.)
/r/Python
https://redd.it/1ouihlq
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Simple Resume: Generate PDF, HTML, and LaTeX resumes from a simple YAML config file
Github: https://github.com/athola/simple-resume
This is a solved problem but I figured I'd implement a resume generation tool with a bit more flexibility and customization available vs the makefile/shell options I found and the out-of-date python projects available in the same realm. It would be awesome to get some other users to check it out and provide critical feedback to improve the tool for the open source community to make simple and elegant resumes without having to pay for it through a resume generation site.
What My Project Does:
This is a CLI tool which allows for defining resume content in a single YAML file and then generating PDF, HTML, or LaTeX rendered resumes from it. The idea is to write the configuration once, then be able to render it in a variety of different iterations.
Target Audience:
Jobseekers, students, academia
Comparison:
pyresume generates latex, has not been updated in 8 years
resume-parser appears to be out of date as well, 5 years since most recent update
resume-markdown has been recently updated and closely matches the goals of this project; there are some differentiators between resume-markdown and this project from a ease of use perspective where the default CSS/HTML doesn't require much modification to output a nice looking resume out of
/r/Python
https://redd.it/1ouxq8q
Github: https://github.com/athola/simple-resume
This is a solved problem but I figured I'd implement a resume generation tool with a bit more flexibility and customization available vs the makefile/shell options I found and the out-of-date python projects available in the same realm. It would be awesome to get some other users to check it out and provide critical feedback to improve the tool for the open source community to make simple and elegant resumes without having to pay for it through a resume generation site.
What My Project Does:
This is a CLI tool which allows for defining resume content in a single YAML file and then generating PDF, HTML, or LaTeX rendered resumes from it. The idea is to write the configuration once, then be able to render it in a variety of different iterations.
Target Audience:
Jobseekers, students, academia
Comparison:
pyresume generates latex, has not been updated in 8 years
resume-parser appears to be out of date as well, 5 years since most recent update
resume-markdown has been recently updated and closely matches the goals of this project; there are some differentiators between resume-markdown and this project from a ease of use perspective where the default CSS/HTML doesn't require much modification to output a nice looking resume out of
/r/Python
https://redd.it/1ouxq8q
GitHub
GitHub - athola/simple-resume: Generate PDF/HTML resume from YAML
Generate PDF/HTML resume from YAML. Contribute to athola/simple-resume development by creating an account on GitHub.
Webcam Rubik's Cube Solver GUI App PySide6 / OpenGL / OpenCV
# Background
This toy-project started as a self-challenge to see if I could build an application that uses the webcam and some foundational computer vision techniques to detect the state of a scrambled Rubik's cube and then show the solution steps to the user.
# Target Audience
As it is a toy-project it is mainly meant for casual use by those who are curious or it serves as an example project for students trying to learn computer vision and/or graphics programming.
# Comparison
I have seen a few projects on GitHub that implement a Rubik's cube facelet detection pipeline but they seem to fall short of actually solving the cube and show the solution to the user. I have also seen a few android solver apps but those don't seem to have a way to auto detect the state of the cube using your phone camera and you need to manually set the state.
# Installation and Usage
git clone https://github.com/pdadhikary/rubiksolver.git
cd rubiksolver
uv sync
uv run rubiksolver
When scanning their Rubik's cube the user should hold up each face of the cube
/r/Python
https://redd.it/1ouwa42
# Background
This toy-project started as a self-challenge to see if I could build an application that uses the webcam and some foundational computer vision techniques to detect the state of a scrambled Rubik's cube and then show the solution steps to the user.
# Target Audience
As it is a toy-project it is mainly meant for casual use by those who are curious or it serves as an example project for students trying to learn computer vision and/or graphics programming.
# Comparison
I have seen a few projects on GitHub that implement a Rubik's cube facelet detection pipeline but they seem to fall short of actually solving the cube and show the solution to the user. I have also seen a few android solver apps but those don't seem to have a way to auto detect the state of the cube using your phone camera and you need to manually set the state.
# Installation and Usage
git clone https://github.com/pdadhikary/rubiksolver.git
cd rubiksolver
uv sync
uv run rubiksolver
When scanning their Rubik's cube the user should hold up each face of the cube
/r/Python
https://redd.it/1ouwa42
GitHub
GitHub - pdadhikary/rubiksolver: A Rubik's cube solver app
A Rubik's cube solver app. Contribute to pdadhikary/rubiksolver development by creating an account on GitHub.
Can I create PDF infographics/reports using Python?
I have a python script that does data scrapping and whatnot to output data into a CSV file. I'd love to know which packages I can use to printout professional graphics and charts and output the data into nice layouts to export it as a PDF on my computer. Any suggestions? I used ChatGPT and it used the basic Matplotlib, but I am wondering what is the best way I can go about creating something like this:
https://cdn.venngage.com/template/thumbnail/small/f7c94e39-a01c-4bba-934c-52bd9330525a.webp
https://cdn.venngage.com/template/thumbnail/small/f7c94e39-a01c-4bba-934c-52bd9330525a.webp
/r/Python
https://redd.it/1our6fw
I have a python script that does data scrapping and whatnot to output data into a CSV file. I'd love to know which packages I can use to printout professional graphics and charts and output the data into nice layouts to export it as a PDF on my computer. Any suggestions? I used ChatGPT and it used the basic Matplotlib, but I am wondering what is the best way I can go about creating something like this:
https://cdn.venngage.com/template/thumbnail/small/f7c94e39-a01c-4bba-934c-52bd9330525a.webp
https://cdn.venngage.com/template/thumbnail/small/f7c94e39-a01c-4bba-934c-52bd9330525a.webp
/r/Python
https://redd.it/1our6fw
Question I'm new
I am doing a project that uses Django rest and vite for the front, I was making a request and it had to send the credentials, cookies or section-id, issue despite doing the configuration of the cords
Front at localhost:8000
Back at 172.0.10... the typical
It didn't work for me, error 400 I think it was
I fixed it by making Back Django serve on the same local host but with a different port.
Is it normal in development to do this? Or I ruined something because I read that the AI didn't help me and neither did it.
I must have explained myself poorly, I'm sure sorry.
/r/djangolearning
https://redd.it/1ouud8w
I am doing a project that uses Django rest and vite for the front, I was making a request and it had to send the credentials, cookies or section-id, issue despite doing the configuration of the cords
Front at localhost:8000
Back at 172.0.10... the typical
It didn't work for me, error 400 I think it was
I fixed it by making Back Django serve on the same local host but with a different port.
Is it normal in development to do this? Or I ruined something because I read that the AI didn't help me and neither did it.
I must have explained myself poorly, I'm sure sorry.
/r/djangolearning
https://redd.it/1ouud8w
Reddit
From the djangolearning community on Reddit
Explore this post and more from the djangolearning community
autopyperf — A tiny Python profiler that gives instant optimization tips
Hey everyone,
I made **autopyperf**, a lightweight Python module that automatically profiles your code and suggests quick optimizations — no setup, no dependencies, just pure Python.
# 🧩 What It Does
autopyperf helps you understand where your code slows down and gives small static suggestions to make it faster.
* ⏱️ Profile functions with a decorator
* 🧮 Analyze whole scripts easily
* 💡 Get simple optimization hints
Example:
from autopyperf import profile_function, profile_script, suggest_optimizations
u/profile_function
def slow_func():
return [i**2 for i in range(100000)]
slow_func()
profile_script("test.py")
suggest_optimizations("test.py")
# 🎯 Target Audience
Made for developers, students, and hobbyists who want quick feedback on code performance without using heavy profilers like `cProfile` or `pyinstrument`.
It’s simple, educational, and perfect for small projects or quick checks.
# ⚖️ How It’s Different
* ✅ No dependencies
* ✅ Dead-simple setup
* 💡 Adds optimization suggestions (something most profilers don’t)
* ❌ No complex graphs or visualizations — intentionally minimal
# ⚙️ Install
pip install autopyperf
or directly:
pip install git+https://github.com/Ithihasmadhu/autopyperf
🔗 **GitHub:** [https://github.com/Ithihasmadhu/autopyperf](https://github.com/Ithihasmadhu/autopyperf)
/r/Python
https://redd.it/1ovghpg
Hey everyone,
I made **autopyperf**, a lightweight Python module that automatically profiles your code and suggests quick optimizations — no setup, no dependencies, just pure Python.
# 🧩 What It Does
autopyperf helps you understand where your code slows down and gives small static suggestions to make it faster.
* ⏱️ Profile functions with a decorator
* 🧮 Analyze whole scripts easily
* 💡 Get simple optimization hints
Example:
from autopyperf import profile_function, profile_script, suggest_optimizations
u/profile_function
def slow_func():
return [i**2 for i in range(100000)]
slow_func()
profile_script("test.py")
suggest_optimizations("test.py")
# 🎯 Target Audience
Made for developers, students, and hobbyists who want quick feedback on code performance without using heavy profilers like `cProfile` or `pyinstrument`.
It’s simple, educational, and perfect for small projects or quick checks.
# ⚖️ How It’s Different
* ✅ No dependencies
* ✅ Dead-simple setup
* 💡 Adds optimization suggestions (something most profilers don’t)
* ❌ No complex graphs or visualizations — intentionally minimal
# ⚙️ Install
pip install autopyperf
or directly:
pip install git+https://github.com/Ithihasmadhu/autopyperf
🔗 **GitHub:** [https://github.com/Ithihasmadhu/autopyperf](https://github.com/Ithihasmadhu/autopyperf)
/r/Python
https://redd.it/1ovghpg
GitHub
GitHub - Ithihasmadhu/autopyperf: Automatic Python performance insights — lightweight, dependency-free, and smart optimization…
Automatic Python performance insights — lightweight, dependency-free, and smart optimization tips. - Ithihasmadhu/autopyperf