How to make flask into an API
I wanna use a frontend framework how do people do this tell me smart people of flask
/r/flask
https://redd.it/1pmfwrb
I wanna use a frontend framework how do people do this tell me smart people of flask
/r/flask
https://redd.it/1pmfwrb
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Scalability - Django Posgres SaaS app
Hello all, we have a saas application that we built on a single database + api + frontend (web and mobile)
as my users grow i will be needing to collect the gps and communicate with them constantly during the day - think of it as thumbtack/service channel tasks etc
in your opinion if i need to sell this to multiple customer and each customer has 100 service reps using this, do you think django and single database with multiple polling would handle 20k concurrent users? whats the impact on the users using web app at the same time etc? database locks? performance issues?
thank you in advance!
/r/django
https://redd.it/1pmjbqi
Hello all, we have a saas application that we built on a single database + api + frontend (web and mobile)
as my users grow i will be needing to collect the gps and communicate with them constantly during the day - think of it as thumbtack/service channel tasks etc
in your opinion if i need to sell this to multiple customer and each customer has 100 service reps using this, do you think django and single database with multiple polling would handle 20k concurrent users? whats the impact on the users using web app at the same time etc? database locks? performance issues?
thank you in advance!
/r/django
https://redd.it/1pmjbqi
Reddit
From the django community on Reddit
Explore this post and more from the django community
Maintaining a separate async API
I recently published a Python package that provides its functionality through both a sync and an async API. Other than the sync/async difference, the two APIs are completely identical. Due to this, there was a lot of copying and pasting around. There was tons of duplicated code, with very few minor, mostly syntactic, differences, for example:
1. Using
2. Using
3. Using tasks instead of threads.
So when there was a change in the API's core logic, the exact same change had to be transferred and applied to the async API.
This was getting a bit tedious, so I decided to write a Python noscript that could completely generate the async API from the core sync API by using certain markers in the form of Python comments. I briefly explain how it works here.
What do you think of this approach? I personally found it extremely helpful, but I haven't really seen it be done before so I'd like to hear your thoughts. Do you know any other projects that do something similar?
EDIT: By using the term "API" I'm simply referring to the public interface of my package, not a typical HTTP API.
/r/Python
https://redd.it/1pme2nx
I recently published a Python package that provides its functionality through both a sync and an async API. Other than the sync/async difference, the two APIs are completely identical. Due to this, there was a lot of copying and pasting around. There was tons of duplicated code, with very few minor, mostly syntactic, differences, for example:
1. Using
async and await keywords.2. Using
asyncio.Queue instead of queue.Queue.3. Using tasks instead of threads.
So when there was a change in the API's core logic, the exact same change had to be transferred and applied to the async API.
This was getting a bit tedious, so I decided to write a Python noscript that could completely generate the async API from the core sync API by using certain markers in the form of Python comments. I briefly explain how it works here.
What do you think of this approach? I personally found it extremely helpful, but I haven't really seen it be done before so I'd like to hear your thoughts. Do you know any other projects that do something similar?
EDIT: By using the term "API" I'm simply referring to the public interface of my package, not a typical HTTP API.
/r/Python
https://redd.it/1pme2nx
GitHub
GitHub - manoss96/onlymaps: A Python micro-ORM
A Python micro-ORM. Contribute to manoss96/onlymaps development by creating an account on GitHub.
Ilya Sutskever is puzzled by the gap between AI benchmarks and the economic impact D
In a recent interview, Ilya Sutskever said:
> This is one of the very confusing things about the models right now. How to reconcile the fact that they are doing so well on evals... And you look at the evals and you go "Those are pretty hard evals"... They are doing so well! But the economic impact seems to be dramatically behind.
I'm sure Ilya is familiar with the idea of "leakage", and he's still puzzled. So how do you explain it?
Edit:
/r/MachineLearning
https://redd.it/1pm2zsb
In a recent interview, Ilya Sutskever said:
> This is one of the very confusing things about the models right now. How to reconcile the fact that they are doing so well on evals... And you look at the evals and you go "Those are pretty hard evals"... They are doing so well! But the economic impact seems to be dramatically behind.
I'm sure Ilya is familiar with the idea of "leakage", and he's still puzzled. So how do you explain it?
Edit:
GPT-5.2 Thinking scored 70% on GDPval, meaning it outperformed industry professionals on economically valuable, well-specified knowledge work spanning 44 occupations./r/MachineLearning
https://redd.it/1pm2zsb
Reddit
From the MachineLearning community on Reddit
Explore this post and more from the MachineLearning community
How do I add an extra plugin to flask-ckeditor?
I found the link https://github.com/helloflask/flask-ckeditor/issues/11 on how to set up mathjax/extra plugin in flask-ckeditor.
I managed to add the mathjax button but the problem is the button isn’t working.
Here is the button but when I click okay https://imgur.com/a/p6BERkd I get 0 output and when I try something like ```$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $``` and click submit I get the output of the query from the Posts table and content column in other_page.html ```is <p>$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $</p> ```
Here is the code.
https://pastebin.com/7D4NXEtH
Here is the link of the instructions on how to add an extra button/plugin.
https://github.com/helloflask/flask-ckeditor/issues/11
Here is an image of my route
https://imgur.com/a/UmLnQpS
Here is some of the plugins notice mathjax
https://imgur.com/a/WuivWet
Here are parts of the error in the browser
https://pastebin.com/YwW47SeA
Also in the ide I get the output errors below
https://pastebin.com/4uQFiQVU
I found this error https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#mathjax-no-config .
The problem is the error above I assume. I click on the first link and get to https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-mathJaxLib
and I see this code ```config.mathJaxLib = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML';```.
I am trying to add ``` <noscript> config.mathJaxLib = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML'; </noscript> ``` to the head or body tag and
/r/flask
https://redd.it/1pmlav2
I found the link https://github.com/helloflask/flask-ckeditor/issues/11 on how to set up mathjax/extra plugin in flask-ckeditor.
I managed to add the mathjax button but the problem is the button isn’t working.
Here is the button but when I click okay https://imgur.com/a/p6BERkd I get 0 output and when I try something like ```$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $``` and click submit I get the output of the query from the Posts table and content column in other_page.html ```is <p>$ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} $</p> ```
Here is the code.
https://pastebin.com/7D4NXEtH
Here is the link of the instructions on how to add an extra button/plugin.
https://github.com/helloflask/flask-ckeditor/issues/11
Here is an image of my route
https://imgur.com/a/UmLnQpS
Here is some of the plugins notice mathjax
https://imgur.com/a/WuivWet
Here are parts of the error in the browser
https://pastebin.com/YwW47SeA
Also in the ide I get the output errors below
https://pastebin.com/4uQFiQVU
I found this error https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#mathjax-no-config .
The problem is the error above I assume. I click on the first link and get to https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-mathJaxLib
and I see this code ```config.mathJaxLib = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML';```.
I am trying to add ``` <noscript> config.mathJaxLib = '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML'; </noscript> ``` to the head or body tag and
/r/flask
https://redd.it/1pmlav2
GitHub
How install plugins ? · Issue #11 · helloflask/flask-ckeditor
Hi, i need plugins in the text editor but i don't now how add them... Plugins i need, font color, font family, etc... I m a beginner, i need clear examples... step by step. Thank you !
Introducing dj-cache-panel, a universal cache inspector for Django.
Hey everyone, I just released **dj-cache-panel**, a lightweight Django admin extension that lets you query and perform actions on your django cache instances.
Django ships with great caching primitives, but debugging cache issues is still basically guesswork. This project gives you a clean admin UI to browse, inspect, and delete keys across different backend types:
* Works with redis, memcached, local memory, database cache backend
* Search keys (prefix, wildcard, exact match) on backends that support it
* Delete keys in one click
* Zero models, zero migrations
* Works completely using your already defined CACHES setting
Repo: [https://github.com/yassi/dj-cache-panel](https://github.com/yassi/dj-cache-panel)
Docs: [https://yassi.github.io/dj-cache-panel/]()
pypi: [https://pypi.org/project/dj-cache-panel/](https://pypi.org/project/dj-cache-panel/)
This work is a natural extension to my previous work dj-redis-panel, so go ahead and check that out as well.
/r/django
https://redd.it/1pmnkrx
Hey everyone, I just released **dj-cache-panel**, a lightweight Django admin extension that lets you query and perform actions on your django cache instances.
Django ships with great caching primitives, but debugging cache issues is still basically guesswork. This project gives you a clean admin UI to browse, inspect, and delete keys across different backend types:
* Works with redis, memcached, local memory, database cache backend
* Search keys (prefix, wildcard, exact match) on backends that support it
* Delete keys in one click
* Zero models, zero migrations
* Works completely using your already defined CACHES setting
Repo: [https://github.com/yassi/dj-cache-panel](https://github.com/yassi/dj-cache-panel)
Docs: [https://yassi.github.io/dj-cache-panel/]()
pypi: [https://pypi.org/project/dj-cache-panel/](https://pypi.org/project/dj-cache-panel/)
This work is a natural extension to my previous work dj-redis-panel, so go ahead and check that out as well.
/r/django
https://redd.it/1pmnkrx
GitHub
GitHub - yassi/dj-cache-panel: A universal cache inspector for Django.
A universal cache inspector for Django. Contribute to yassi/dj-cache-panel development by creating an account on GitHub.
Monday Daily Thread: Project ideas!
# Weekly Thread: Project Ideas 💡
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
## How it Works:
1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.
## Guidelines:
* Clearly state the difficulty level.
* Provide a brief denoscription and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.
# Example Submissions:
## Project Idea: Chatbot
**Difficulty**: Intermediate
**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar
**Denoscription**: Create a chatbot that can answer FAQs for a website.
**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)
# Project Idea: Weather Dashboard
**Difficulty**: Beginner
**Tech Stack**: HTML, CSS, JavaScript, API
**Denoscription**: Build a dashboard that displays real-time weather information using a weather API.
**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)
## Project Idea: File Organizer
**Difficulty**: Beginner
**Tech Stack**: Python, File I/O
**Denoscription**: Create a noscript that organizes files in a directory into sub-folders based on file type.
**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)
Let's help each other grow. Happy
/r/Python
https://redd.it/1pmt0u0
# Weekly Thread: Project Ideas 💡
Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.
## How it Works:
1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.
## Guidelines:
* Clearly state the difficulty level.
* Provide a brief denoscription and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.
# Example Submissions:
## Project Idea: Chatbot
**Difficulty**: Intermediate
**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar
**Denoscription**: Create a chatbot that can answer FAQs for a website.
**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)
# Project Idea: Weather Dashboard
**Difficulty**: Beginner
**Tech Stack**: HTML, CSS, JavaScript, API
**Denoscription**: Build a dashboard that displays real-time weather information using a weather API.
**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)
## Project Idea: File Organizer
**Difficulty**: Beginner
**Tech Stack**: Python, File I/O
**Denoscription**: Create a noscript that organizes files in a directory into sub-folders based on file type.
**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)
Let's help each other grow. Happy
/r/Python
https://redd.it/1pmt0u0
YouTube
Build & Integrate your own custom chatbot to a website (Python & JavaScript)
In this fun project you learn how to build a custom chatbot in Python and then integrate this to a website using Flask and JavaScript.
Starter Files: https://github.com/patrickloeber/chatbot-deployment
Get my Free NumPy Handbook: https://www.python-engi…
Starter Files: https://github.com/patrickloeber/chatbot-deployment
Get my Free NumPy Handbook: https://www.python-engi…
Django Roadmap at roadmap.sh
Hi there! My name is Javier Canales, and I work as a content editor at roadmap.sh. For those who don't know, roadmap.sh is a community-driven website offering visual roadmaps, study plans, and guides to help developers navigate their career paths in technology.
We're planning to launch a brand new Django Roadmap. It aims to be comprehensive, targeting Django newbies and mature developers who may want a Django refresh or to improve their fluency. Our primary source is the Django Documentation. However, we're not covering all the topics out there, as we don't want to overwhelm users with an extremely large roadmap.
Before launching the roadmap, we would like to ask the community for some help. Here's the link to the draft roadmap. We welcome your feedback, suggestions, and constructive input. If you have any suggestions for items to include or remove from the roadmap, please let me know.
Once we launch the official roadmap, we will start populating it with content and resources. Contributions will also be welcome on that side via GitHub :)
Hope this incoming roadmap will also be useful for you. Thanks very much in advance.
https://preview.redd.it/3afo8tdlnr6g1.png?width=734&format=png&auto=webp&s=503dc4221f87a42280f6256a13fa787836b69dba
/r/djangolearning
https://redd.it/1pkrfn5
Hi there! My name is Javier Canales, and I work as a content editor at roadmap.sh. For those who don't know, roadmap.sh is a community-driven website offering visual roadmaps, study plans, and guides to help developers navigate their career paths in technology.
We're planning to launch a brand new Django Roadmap. It aims to be comprehensive, targeting Django newbies and mature developers who may want a Django refresh or to improve their fluency. Our primary source is the Django Documentation. However, we're not covering all the topics out there, as we don't want to overwhelm users with an extremely large roadmap.
Before launching the roadmap, we would like to ask the community for some help. Here's the link to the draft roadmap. We welcome your feedback, suggestions, and constructive input. If you have any suggestions for items to include or remove from the roadmap, please let me know.
Once we launch the official roadmap, we will start populating it with content and resources. Contributions will also be welcome on that side via GitHub :)
Hope this incoming roadmap will also be useful for you. Thanks very much in advance.
https://preview.redd.it/3afo8tdlnr6g1.png?width=734&format=png&auto=webp&s=503dc4221f87a42280f6256a13fa787836b69dba
/r/djangolearning
https://redd.it/1pkrfn5
roadmap.sh
Developer Roadmaps - roadmap.sh
Community driven roadmaps, articles and guides for developers to grow in their career.
Released dataclass-wizard 0.36.0: v1 dumpers, new DataclassWizard class, and performance cleanup
I just released dataclass-wizard 0.36.0 after a bit of a gap (got busy with grad school) and wanted to share a few highlights.
dataclass-wizard is a small library for loading/dumping dataclasses from JSON with flexible key casing and type coercion.
What’s new in 0.36.0:
• New
• Proper v1 dumpers module (finally 😅) — much cleaner separation and better dump performance
• Cleaner v1 config API (
• Internal refactors to make the v1 load/dump pipeline more maintainable going forward
One thing I’m particularly happy about in this release is finally splitting out v1 dump logic into its own module instead of having it tangled with legacy paths — it simplified the code a lot and made performance tuning easier.
Docs: https://dataclass-wizard.ritviknag.com/
GitHub: https://github.com/rnag/dataclass-wizard
Would love feedback from folks who’ve built serialization layers or dealt with dataclass/typing edge cases.
/r/Python
https://redd.it/1pmsj0n
I just released dataclass-wizard 0.36.0 after a bit of a gap (got busy with grad school) and wanted to share a few highlights.
dataclass-wizard is a small library for loading/dumping dataclasses from JSON with flexible key casing and type coercion.
What’s new in 0.36.0:
• New
DataclassWizard base class (auto-applies @dataclass) — this will be the default direction for v1• Proper v1 dumpers module (finally 😅) — much cleaner separation and better dump performance
• Cleaner v1 config API (
v1_case instead of v1_key_case)• Internal refactors to make the v1 load/dump pipeline more maintainable going forward
One thing I’m particularly happy about in this release is finally splitting out v1 dump logic into its own module instead of having it tangled with legacy paths — it simplified the code a lot and made performance tuning easier.
Docs: https://dataclass-wizard.ritviknag.com/
GitHub: https://github.com/rnag/dataclass-wizard
Would love feedback from folks who’ve built serialization layers or dealt with dataclass/typing edge cases.
/r/Python
https://redd.it/1pmsj0n
GitHub
GitHub - rnag/dataclass-wizard: Simple, elegant, wizarding tools for interacting with Python's dataclasses.
Simple, elegant, wizarding tools for interacting with Python's dataclasses. - rnag/dataclass-wizard
Django blog with multiple images per post
I have built a basic blog with a single
I was able to handle the part with uploading multiple images, I need the ability to insert these images anywhere within the article body, rather than just looping through an array of images and displaying them in one place.
P.S I don't wan't to build every page manually.
/r/django
https://redd.it/1pmpkjk
I have built a basic blog with a single
Post model. and it is limited to one image per post, which serves as the cover image.I was able to handle the part with uploading multiple images, I need the ability to insert these images anywhere within the article body, rather than just looping through an array of images and displaying them in one place.
P.S I don't wan't to build every page manually.
/r/django
https://redd.it/1pmpkjk
Reddit
From the django community on Reddit
Explore this post and more from the django community
Kreuzberg v4.0.0-rc.8 is available
Hi Peeps,
I'm excited to announce that Kreuzberg v4.0.0 is coming very soon. We will release v4.0.0 at the beginning of next year - in just a couple of weeks time. For now, v4.0.0-rc.8 has been released to all channels.
## What is Kreuzberg?
Kreuzberg is a document intelligence toolkit for extracting text, metadata, tables, images, and structured data from 56+ file formats. It was originally written in Python (v1-v3), where it demonstrated strong performance characteristics compared to alternatives in the ecosystem.
## What's new in V4?
### A Complete Rust Rewrite with Polyglot Bindings
The new version of Kreuzberg represents a massive architectural evolution. Kreuzberg has been completely rewritten in Rust - leveraging Rust's memory safety, zero-cost abstractions, and native performance. The new architecture consists of a high-performance Rust core with native bindings to multiple languages. That's right - it's no longer just a Python library.
Kreuzberg v4 is now available for 7 languages across 8 runtime bindings:
- Rust (native library)
- Python (PyO3 native bindings)
- TypeScript - Node.js (NAPI-RS native bindings) + Deno/Browser/Edge (WASM)
- Ruby (Magnus FFI)
- Java 25+ (Panama Foreign Function & Memory API)
- C# (P/Invoke)
- Go (cgo bindings)
Post v4.0.0 roadmap includes:
- PHP
- Elixir (via Rustler - with Erlang and Gleam interop)
Additionally, it's available as
/r/Python
https://redd.it/1pn2a3t
Hi Peeps,
I'm excited to announce that Kreuzberg v4.0.0 is coming very soon. We will release v4.0.0 at the beginning of next year - in just a couple of weeks time. For now, v4.0.0-rc.8 has been released to all channels.
## What is Kreuzberg?
Kreuzberg is a document intelligence toolkit for extracting text, metadata, tables, images, and structured data from 56+ file formats. It was originally written in Python (v1-v3), where it demonstrated strong performance characteristics compared to alternatives in the ecosystem.
## What's new in V4?
### A Complete Rust Rewrite with Polyglot Bindings
The new version of Kreuzberg represents a massive architectural evolution. Kreuzberg has been completely rewritten in Rust - leveraging Rust's memory safety, zero-cost abstractions, and native performance. The new architecture consists of a high-performance Rust core with native bindings to multiple languages. That's right - it's no longer just a Python library.
Kreuzberg v4 is now available for 7 languages across 8 runtime bindings:
- Rust (native library)
- Python (PyO3 native bindings)
- TypeScript - Node.js (NAPI-RS native bindings) + Deno/Browser/Edge (WASM)
- Ruby (Magnus FFI)
- Java 25+ (Panama Foreign Function & Memory API)
- C# (P/Invoke)
- Go (cgo bindings)
Post v4.0.0 roadmap includes:
- PHP
- Elixir (via Rustler - with Erlang and Gleam interop)
Additionally, it's available as
/r/Python
https://redd.it/1pn2a3t
GitHub
GitHub - kreuzberg-dev/kreuzberg: A polyglot document intelligence framework with a Rust core. Extract text, metadata, and structured…
A polyglot document intelligence framework with a Rust core. Extract text, metadata, and structured information from PDFs, Office documents, images, and 50+ formats. Available for Rust, Python, Rub...
Choosing Django model translation libraries in 2025
I’m looking for advice on choosing a model translation library for a Django + DRF application in 2025. We’re using PostgreSQL.
The use case is fairly typical:
Clients can add multiple translations for certain model fields (e.g. `name`, `denoscription` on an `Item` model)
When fetching data via the API, we return the correct translation dynamically based on a parameter (e.g. request header)
I’ve looked into the existing options, and it seems like there are three main contenders. I’d love to hear what others are using in production today, and what would you recommend.
Below is short summary of translation libraries i found and my thoughts on them, I'm not very familiar with Django ecosystem so any insights are appreciated
**Modeltranslation**
Utilizes one column per language per translatable field, no separate table, no joins, no jsonb stored, if you have 5 languages for model with 3 translatable fields you end up with extra 15 columns.
This one seems to have some activity, with fixes getting added to main recently and releases happening regularly. Seems like only non abandoned pick even though I'm not stoked about bloating tables with translations.
**Django-Parler**
Utilizes translation table
What worries me here is that it had last commit on `main` branch on Sep 3, 2022,
/r/django
https://redd.it/1pn4kio
I’m looking for advice on choosing a model translation library for a Django + DRF application in 2025. We’re using PostgreSQL.
The use case is fairly typical:
Clients can add multiple translations for certain model fields (e.g. `name`, `denoscription` on an `Item` model)
When fetching data via the API, we return the correct translation dynamically based on a parameter (e.g. request header)
I’ve looked into the existing options, and it seems like there are three main contenders. I’d love to hear what others are using in production today, and what would you recommend.
Below is short summary of translation libraries i found and my thoughts on them, I'm not very familiar with Django ecosystem so any insights are appreciated
**Modeltranslation**
Utilizes one column per language per translatable field, no separate table, no joins, no jsonb stored, if you have 5 languages for model with 3 translatable fields you end up with extra 15 columns.
This one seems to have some activity, with fixes getting added to main recently and releases happening regularly. Seems like only non abandoned pick even though I'm not stoked about bloating tables with translations.
**Django-Parler**
Utilizes translation table
What worries me here is that it had last commit on `main` branch on Sep 3, 2022,
/r/django
https://redd.it/1pn4kio
Built a Japanese learning game using Django & Vanilla JS. Focus on "Zen" aesthetics.
/r/django
https://redd.it/1pn4g2r
/r/django
https://redd.it/1pn4g2r
Strategies for removing django-polymorphic from codebase
As per the noscript... The codebase grew with polymorphic in place, but it is causing more headaches and testing nightmares than the little abstraction help it provides. Going about removing it from some rather central models, while keeping all data and transferring to inheriting from abstract base classes instead, has been veeeery painful to say the least.
Anybody done the move and have some pointers?
/r/django
https://redd.it/1pmow0e
As per the noscript... The codebase grew with polymorphic in place, but it is causing more headaches and testing nightmares than the little abstraction help it provides. Going about removing it from some rather central models, while keeping all data and transferring to inheriting from abstract base classes instead, has been veeeery painful to say the least.
Anybody done the move and have some pointers?
/r/django
https://redd.it/1pmow0e
Reddit
From the django community on Reddit
Explore this post and more from the django community
How to implement phone number + OTP login with django-allauth?
I’m currently working on a Django project and I have a requirement to allow users to log in using their Phone Number and an OTP (One-Time Password) via SMS, beside the standard Email/Username + Password combo.
I'd really like to use
I know that recent versions of
If anyone has implemented a Phone+OTP flow specifically with
Thanks in advance!
/r/django
https://redd.it/1pluo6i
I’m currently working on a Django project and I have a requirement to allow users to log in using their Phone Number and an OTP (One-Time Password) via SMS, beside the standard Email/Username + Password combo.
I'd really like to use
django-allauth for auth features.I know that recent versions of
django-allauth added ACCOUNT_PHONE_VERIFICATION_ENABLED and support for phone numbers as a primary identifier, but I don't know how to implement phone number + OTP login.If anyone has implemented a Phone+OTP flow specifically with
django-allauth recently, I’d love to hear how you approached.Thanks in advance!
/r/django
https://redd.it/1pluo6i
Reddit
From the django community on Reddit
Explore this post and more from the django community
Miguel's Flask Course
Hi all,
I'm currently learning Flask and after some due diligence I dove into Miguel's course. I felt good for the first few chapters and was grasping concepts pretty well then things started to get more complicated, I think more so the things that were introduced outside of the scope of Flask (third party libraries that are used) and it just completely knocked me off my horse. I feel like I'm just watching the videos now. I've made it to pretty much the end of the course but I don't feel like I've learnt as much as I should or could've. I'm not sure whether I'm too dumb or what's limiting me. Is it normal to find this course hard? Everyone says it's the go to for Flask and that's incredible, but I've honestly struggled immensley with it.
I moved to flask after I learnt JS and React, built some of my own little projects and felt comfortable enough to move on. I didn't really experience roadblocks like this with JS and React. But Flask, although the simple routes and whatnot are easy, it's beyond that when I feel stuck. I'm not sure what to do now, I've been learning
/r/flask
https://redd.it/1pnblkp
Hi all,
I'm currently learning Flask and after some due diligence I dove into Miguel's course. I felt good for the first few chapters and was grasping concepts pretty well then things started to get more complicated, I think more so the things that were introduced outside of the scope of Flask (third party libraries that are used) and it just completely knocked me off my horse. I feel like I'm just watching the videos now. I've made it to pretty much the end of the course but I don't feel like I've learnt as much as I should or could've. I'm not sure whether I'm too dumb or what's limiting me. Is it normal to find this course hard? Everyone says it's the go to for Flask and that's incredible, but I've honestly struggled immensley with it.
I moved to flask after I learnt JS and React, built some of my own little projects and felt comfortable enough to move on. I didn't really experience roadblocks like this with JS and React. But Flask, although the simple routes and whatnot are easy, it's beyond that when I feel stuck. I'm not sure what to do now, I've been learning
/r/flask
https://redd.it/1pnblkp
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Building the Fastest Python CI
Hey all, there is a frustrating lack of resources and tooling for building Python CIs in a monorepo setting so I wrote up how we do it at $job.
# What my project does
We use uv as a package manager and pex to bundle our Python code and dependencies into executables. Pex recently added a feature that allows it to consume its dependencies from uv which drastically speeds up builds. This trick is included in the guide. Additionally, to keep our builds fast and vertically scalable we use a light-weight build system called Grog that allows us to cache and skip builds aswell as run them in parallel.
# Target Audience
Anyone building Python CI pipelines at small to medium scale.
# Comparison
The closest comparison to this would be Pants which comes with a massive complexity tasks and does not play well with existing dev tooling (more about this in the post). This approach on the other hand builds on top of uv and thus keeps the setup pretty lean while still delivering great performance.
Let me know what you think 🙏
Guide: https://chrismati.cz/posts/building-the-fastest-python-ci/
Demo repository: https://github.com/chrismatix/uv-pex-monorepo
/r/Python
https://redd.it/1pnbze0
Hey all, there is a frustrating lack of resources and tooling for building Python CIs in a monorepo setting so I wrote up how we do it at $job.
# What my project does
We use uv as a package manager and pex to bundle our Python code and dependencies into executables. Pex recently added a feature that allows it to consume its dependencies from uv which drastically speeds up builds. This trick is included in the guide. Additionally, to keep our builds fast and vertically scalable we use a light-weight build system called Grog that allows us to cache and skip builds aswell as run them in parallel.
# Target Audience
Anyone building Python CI pipelines at small to medium scale.
# Comparison
The closest comparison to this would be Pants which comes with a massive complexity tasks and does not play well with existing dev tooling (more about this in the post). This approach on the other hand builds on top of uv and thus keeps the setup pretty lean while still delivering great performance.
Let me know what you think 🙏
Guide: https://chrismati.cz/posts/building-the-fastest-python-ci/
Demo repository: https://github.com/chrismatix/uv-pex-monorepo
/r/Python
https://redd.it/1pnbze0
Christoph Pröschel
Building the fastest Python CI
Learn how to build a blazingly fast Python CI pipeline using uv, pex, and Grog. This post shows how to combine uv’s dependency caching with pex’s executable bundling to achieve sub-second build times in Python monorepos. We’ll explore techniques for dependency…
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/1pnn7xm
# 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/1pnn7xm
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. | 413614 members
Looking for CSS frameworks, recommendations?
For my next project I'm staying with full stack Django templating with htmx I'm terrible at CSS and I hate writing it. A few of you will moan about that but I like frame works that have lots of components.
Do you have any recommendations?
Boot strap
Metroui
Beercss
Basecoatui
All great 👍 but are there anymore hiding in the wood work?
/r/django
https://redd.it/1pnlff8
For my next project I'm staying with full stack Django templating with htmx I'm terrible at CSS and I hate writing it. A few of you will moan about that but I like frame works that have lots of components.
Do you have any recommendations?
Boot strap
Metroui
Beercss
Basecoatui
All great 👍 but are there anymore hiding in the wood work?
/r/django
https://redd.it/1pnlff8
Reddit
From the django community on Reddit
Explore this post and more from the django community
Why don't
Both the standard `dataclasses` and the third-party `attrs` package follow the same approach: if you want to tell if an object or type is created using them, you need to do it in a non-standard way (call
/r/Python
https://redd.it/1pnne6l
dataclasses or attrs derive from a base class?Both the standard `dataclasses` and the third-party `attrs` package follow the same approach: if you want to tell if an object or type is created using them, you need to do it in a non-standard way (call
dataclasses.is_dataclass(), or catch attrs.NotAnAttrsClassError). It seems that both of them rely on setting a magic attribute in generated classes, so why not have them derive from an ABC with that attribute declared (or make it a property), so that users could use the standard isinstance? Was it performance considerations or something else?/r/Python
https://redd.it/1pnne6l
Python documentation
dataclasses — Data Classes
Source code: Lib/dataclasses.py This module provides a decorator and functions for automatically adding generated special methods such as__init__() and__repr__() to user-defined classes. It was ori...
P Built semantic PDF search with sentence-transformers + DuckDB - benchmarked chunking approaches
I built DocMine to make PDF research papers and documentation semantically searchable. 3-line API, runs locally, no API keys.
Architecture:
PyMuPDF (extraction) → Chonkie (semantic chunking) → sentence-transformers (embeddings) → DuckDB (vector storage)
Key decision: Semantic chunking vs fixed-size chunks
\- Semantic boundaries preserve context across sentences
\- \~20% larger chunks but significantly better retrieval quality
\- Tradeoff: 3x slower than naive splitting
Benchmarks (M1 Mac, Python 3.13):
\- 48-page PDF: 104s total (13.5s embeddings, 3.4s chunking, 0.4s extraction)
\- Search latency: 425ms average
\- Memory: Single-file DuckDB, <100MB for 1500 chunks
Example use case:
```python
from docmine.pipeline import PDFPipeline
pipeline = PDFPipeline()
pipeline.ingest_directory("./papers")
results = pipeline.search("CRISPR gene editing methods", top_k=5)
GitHub: https://github.com/bcfeen/DocMine
Open questions I'm still exploring:
1. When is semantic chunking worth the overhead vs simple sentence splitting?
2. Best way to handle tables/figures embedded in PDFs?
3. Optimal chunk_size for different document types (papers vs manuals)?
Feedback on the architecture or chunking approach welcome!
/r/Python
https://redd.it/1pnvuhf
I built DocMine to make PDF research papers and documentation semantically searchable. 3-line API, runs locally, no API keys.
Architecture:
PyMuPDF (extraction) → Chonkie (semantic chunking) → sentence-transformers (embeddings) → DuckDB (vector storage)
Key decision: Semantic chunking vs fixed-size chunks
\- Semantic boundaries preserve context across sentences
\- \~20% larger chunks but significantly better retrieval quality
\- Tradeoff: 3x slower than naive splitting
Benchmarks (M1 Mac, Python 3.13):
\- 48-page PDF: 104s total (13.5s embeddings, 3.4s chunking, 0.4s extraction)
\- Search latency: 425ms average
\- Memory: Single-file DuckDB, <100MB for 1500 chunks
Example use case:
```python
from docmine.pipeline import PDFPipeline
pipeline = PDFPipeline()
pipeline.ingest_directory("./papers")
results = pipeline.search("CRISPR gene editing methods", top_k=5)
GitHub: https://github.com/bcfeen/DocMine
Open questions I'm still exploring:
1. When is semantic chunking worth the overhead vs simple sentence splitting?
2. Best way to handle tables/figures embedded in PDFs?
3. Optimal chunk_size for different document types (papers vs manuals)?
Feedback on the architecture or chunking approach welcome!
/r/Python
https://redd.it/1pnvuhf
GitHub
GitHub - bcfeen/DocMine: Semantic PDF knowledge extraction made simple
Semantic PDF knowledge extraction made simple. Contribute to bcfeen/DocMine development by creating an account on GitHub.