r/django • u/radiacnet • 8h ago
r/django • u/VirtualMycologist406 • 19h ago
Data organise
Hi everyone. I need your help. I need to organise my data somehow in “data.py” file. Now I don’t use database, so I need your recommendation how to do this, for they later I can easily switch it in database. P.S. I would do db from the start but this is a task from my teacher
r/django • u/Beneficial_Look_7398 • 2d ago
Hosting and deployment Performance with db
galleryI had created a post : https://www.reddit.com/r/django/s/DVeZXAHGhs about the performance of the db that I was using with my personal project. I got many helpful suggestions from the post and tried to find what the root cause was but I didn't find anything in particular. Then I used the same application with a local dev db and compared the performance and the result is huge difference. Here the first one is from my local machine, and the second is from the postgres from neon db (free tier).
Before you state the obvious, yes the local server is supposed to take much less time the the one that is hosted somewhere and you need to communicate over the network, now with this can I be sure that the issue is with the Db provider, at first I was wonder if I the code was inefficient or there was something wrong with my code.
and still, neon db is a popular provider and I can't understand why would their provided db be that it is noticeable request is noticeable?
r/django • u/creasta29 • 2d ago
Podcast HTMX creator on HTMX 4, the history of REST and how he views AI
youtu.beI host a podcast for senior engineers and recently had Carson Gross, creator of HTMX, on as a guest. We covered how REST was originally defined, how the industry ended up calling JSON over HTTP "REST", and why he thinks returning HTML from the server is closer to the original idea.
We also got into HTMX 4, when you actually do need a SPA, and how AI changes the tradeoff between simple and clever code.
Full episode: https://youtu.be/9xs0oZN2rs4
4' video on the history of REST: https://www.youtube.com/watch?v=DbNvpiJ9gTs
r/django • u/DowntownEmergency889 • 1d ago
High School Project Looking for a Coder/Developer
r/django • u/Radiant-Winner7059 • 1d ago
Would like for users to test my site!
Would like a update on my project
r/django • u/Alternative_Cold_976 • 2d ago
Express vs Django
Which one is better for web development, I mainly use Express, but is Django also good? For frontend, I use react, for database I use mongoDB, does mongoDB work on Django as well?
r/django • u/Beneficial_Look_7398 • 3d ago
Is this normal performance or not?
galleryHello guys, I am building a personal project simple blog application with react frontend and drf backend, for image upload I have used Cloudinary and have deployed the backend in vercel and used postgers from neon db put the amount of time it is taking for a request to complete is quite noticeable is this normal ? all of the things I am using here is free tier. during development I have used the debug toolbar and I have made sure that there is no n + 1 condition, I see the response time in sites like youtube, facebook the request is completed within milliseconds.
This is my first time deploying things so any help would be really appreciated plus even when I run the local backend server which is using cloudinary and neon db it takes about half of the time shown in the below picture, within the local dev server too it taks about 1-2s on average.
r/django • u/AuthByExample • 3d ago
REST framework DRF skips has_object_permission on list endpoints. How do you keep get_queryset scoped?
In Django REST Framework, object permissions only run when a view calls get_object(). Retrieve, update and destroy do that. List doesn't, so a permission class that checks obj.workspace_id == request.user.workspace_id protects the detail routes and does nothing for the list route. If get_queryset is still Project.objects.all(), the list returns every workspace's rows. Same goes for a custom @action(detail=False), or an overridden get_object that forgets to call check_object_permissions.
Filtering in get_queryset fixes it, but then the rule lives in two places, and nothing fails when the next viewset gets written without the filter.
How are people handling this?
- A base viewset whose
get_querysetalways applies the tenant filter, with an explicit opt-out? - A
for_user(user)queryset method plus a review or lint rule? - Tests that create data in two workspaces and call every list route as the wrong user?
Also curious if anyone runs django-guardian's get_objects_for_user on large tables and how it holds up.
r/django • u/rootkill007 • 3d ago
Django REST Framework API architecture
One thing I've found important when structuring a Django REST Framework project is keeping the API layer separate from business logic.
I generally use serializers for input validation and response formatting, views or viewsets for handling HTTP requests, and a separate service layer when the business logic becomes complex enough to justify it.
For example, if an endpoint creates an order, I wouldn't put all the pricing calculations, inventory checks, and payment-related logic directly inside the view. I'd keep those operations in reusable functions or services, with database transactions where consistency requires them.
I also pay attention to a few things early on:
- Consistent API error responses.
- Authentication and object-level permissions.
- Query optimization with
select_related()andprefetch_related()where appropriate. - Automated tests for important business rules.
- Pagination and filtering for endpoints that return large datasets.
I wouldn't introduce a service layer for every simple CRUD operation, though. For a small application, Django's built-in patterns can be perfectly adequate. The goal is to keep the code understandable as the application grows, not to add abstraction for its own sake.
r/django • u/Cold_Percentage9661 • 3d ago
API AI
Hello friends. I have this question.. what kind of neural network is there for integration into your site written in django? The idea is as follows: the user writes a prompt (with photos), then this prompt goes to the neural network, and Django returns the finished video to my site. The main thing is that the neural network is free or at least there is some normal limit. Who was involved, can you tell me?
r/django • u/AcceptableAmount6028 • 4d ago
Hosting and deployment New to Django + Gunicorn + Nginx: what's your workflow for efficient development, deployment, and debugging in production?
Hi all! I'm new to production Django (Django + Gunicorn + Nginx) and want to build good habits early.
What are your best practices for:
- Development: local setup, settings split, must-have tools
- Deployment: Docker vs systemd, CI/CD, static files, secrets
- Debugging in production: logging, monitoring, error tracking
- Mistakes to avoid
Any tips, tools, or resources welcome. Thanks! 🙏
r/django • u/Hotel_Arrakis • 4d ago
HIPAA compliant web hosting
I developed a Django app for a small healthcare provider. Does anyone have recommendations for a hosting provider that is HIPAA compliant and the cost? Any pitfalls to watch out for?
r/django • u/NoLibrarian2289 • 4d ago
Passing tests doesn't mean your code is correct — a small Python experiment
r/django • u/Technical_Tie1974 • 5d ago
I built a production-ready software foundation to skip the "platform rebuild" phase. What parts of this setup do you hate doing the most ?
I’ve been standardizing my application infrastructure to skip the platform assembly phase and go straight from local dev to a single-server VM deployment (AWS, Hetzner, DigitalOcean).
I'm trying to gauge how much of a bottleneck this initial plumbing actually is for other founders starting new B2B projects.
Reference Tech Stack:
- Frontend Reference: React, TypeScript, Vite, Tailwind, Zustand, Bun, Playwright
- Backend Reference: Python, Django, DRF, Celery, RabbitMQ, Redis, PostgreSQL, Unfold for Admin
- Observability: Pre-configured Grafana, Loki, Tempo, Prometheus, OpenTelemetry
- Infrastructure : GitHub Actions pipelines for building images/branch and deployment on remote VM via ssh, Docker Compose configs, Deployment health check reports , Nginx (subdomain support), Let's encrypt, Docs for setting up server.
(Note: The foundation enforces application contracts using Docker containers, meaning the application stack itself is fully modular. While the reference implementation uses Django and React, you can swap in Node.js, Go, or Java on the backend, or Angular and Vue on the frontend, while keeping the exact same CI/CD, deployment, and observability infrastructure.)
Entire stack can be booted up with one single command just demo which pull and builds all the images locally exact replica of stack to be deployed on production.
For developers starting a new application:
- Do you realistically build this level of CI/CD and distributed tracing from scratch every time, or do you have your own internal templates?
- What is the most frustrating part of this initial setup to maintain as the product scales?
- Is there a specific part of the DevOps plumbing you'd gladly outsource so you can just focus on building product features?
I'm especially interested in hearing how others handle containerized deployments across different backend/frontend stacks.





r/django • u/Living_Dig_6828 • 5d ago
Made an accessibility linter for Django templates, is this useful?
r/django • u/sarmapranab18 • 6d ago
How Deep Should We Go When Learning a Framework Like Django?
Hi everyone, I have a question. When learning or using Django, should I try to understand how every class and object works internally, or is it enough to know how to use them effectively?
For example, when I use generic views, I get curious about how they work behind the scenes, how inheritance works, and how everything is implemented. I end up spending so much time digging into these details that I lose focus on actually writing code and building things.
Even when I manage to understand some of the internals, I often forget them when I revisit them later.
I'd love to hear your thoughts, and anyone is welcome to share their advice based on their own experience!
Web App are overrated, Deploy django in VMs ($8 - $16) are enough
This includes azure web service, digitalOcean apps, render, etc
Web apps are like containers that are only run code, one advantage of vm it come with all you need to run your project
I only use Azure Blob for media and files storage db backup, but database and app engine are running in one vms
This is a 8usd vm performance hire
r/django • u/unequivocally_retard • 5d ago
Article For experienced dev. How u use AI
How yall use AI. (vibe coding) im working with django and other technologies since 2020
With AI at first i usedto get help from chatgpt
But after opus 4.6 i started to make my frontend 90% with claude
At opus 4.7 i started letting claude code write some stuff and check some stuff
But after opus 5.5 sometimes i dont even read the output
Specifically when it does something that doeant effect the core business. Am i the only one?
I love writing code by hand and figuring stuff out by my own
But it feels useless now since i canmove 10 timesthe speed
With not much big of a quality loss
r/django • u/Jolly-Play3558 • 6d ago
¿Cual es el roadmap actual de Django para ustedes?
Con esta revolución de la ia, como ven un roadmap a nivel mid-high para poder mejorar en Django?
¿Que hará que se diferencia un buen programador en Django de lo que no?
r/django • u/Unknown_4nonymous • 7d ago
I built Certifier: An open-source tool to design, issue, and verify certificates in bulk
galleryEvery workshop and hackathon has the same final boss:
“Can we get the certificates by tonight?” 😅
Then begins the traditional ritual: duplicate a design, change one name, export, repeat… and quietly wonder whether anyone will notice the typo in certificate #47.
I started building a small fix for that problem.
After lots of JOMFS — Just One More Feature Syndrome — it became something more. 🔧
A name field became a visual certificate editor.
A CSV upload became bulk generation.
A download button became issuance to each student’s own account.
And, naturally, certificates needed QR codes, public verification, and revocation status.
That project is now open source: Certifier — a tool for designing, issuing, and verifying certificates.
What it can do
- Upload a certificate design or import one from Canva
- Place text, logos, signatures, and QR codes in a visual editor
- Generate certificates in bulk from a CSV
- Deliver certificates to the right student via email or roll number
- Let anyone verify a certificate through a QR code or public code
- Show whether a certificate is valid or revoked
Tech stack
- Backend: Django
- Task processing: Celery
- Frontend: Next.js
- License: AGPL-3.0
Run docker compose up and you can have a working setup with demo data in a few minutes.
Explore the code
- Backend: https://github.com/Shantanu700/certifier_reloaded_backend
- Frontend: https://github.com/Shantanu700/certifier_reloaded_frontend
I'd love contributions: bug reports, fixes, documentation, feature ideas, and feedback from anyone who has had to survive certificate season. 💬
I'm especially interested in feedback on the architecture, verification workflow, and features that would make this useful for colleges, workshops, and hackathons.
If you've built something similar or dealt with certificate generation at scale, I'd love to hear how you approached it!
r/django • u/blopker1 • 7d ago
Releases Dynimg - Dynamic images from HTML
Hey everyone, I just put out version 0.2.0 of Dynimg. It's a Python/Rust package that takes in HTML/CSS and outputs high quality images. If you've ever had to deal with generating images for blog posts (for OG/preview images etc), you know the options are either to run a full headless browser, or build a complicated Pillow pipeline.
I've been making Django apps since version 0.96 (I'm old, sorry), and this is a problem I've needed a solution for many times. It's now finally possible because of another project called Blitz, which is a modular browser built in Rust.
Dynimg is a focused wrapper around parts of Blitz designed around just turning custom HTML and CSS into crisp static images. It's very fast (~20ms) compared to using a full browser to do the same thing. While there's no Django-specific integrations, it works well with Django templates using render_to_string as input.
Example Django code:
import dynimg
html = render_to_string("og.html", ctx)
dynimg.render(html).save_png("og.png")
We've been using Dynimg in production with Django at totem.org for a while now, and it's been just chugging along without issue, so I thought I'd share it here in case anyone else finds it useful.
Despite not being version 1 yet, it is largely feature complete. The main issue is Blitz is still early and there will be slight rendering differences as it matures. However, if you pin Dynimg your images stay stable.
It supports external and local assets (images, CSS, fonts, etc). It works well with Google Fonts for example. Comes with a CLI, Python API and Rust API. It supports PNG, JPEG, and WebP outputs.
Limitations:
- This is not designed to take arbitrary HTML from websites to make screenshots. It is for turning small custom templates into images quickly.
- It's designed to be secure (network and filesystem access are off by default), but it's not designed to take arbitrary user-submitted documents. If you want to use it this way and you find a security flaw, let me know in the repo.
- It does not support JavaScript.
- It does not support every CSS/HTML feature (though more support is added all the time), so make sure to verify it's doing what you want. You may need hacks to get images rendering like a real browser.
- The output images are reasonably sized, but the encoding options are geared for quality. You may want to use a library to fully optimize the image for your use case, then cache it for production.
We currently use it to make dynamic OG and social media images. We host a secret URL on Django for staff to use images how they want: example. You can see example templates here, with how they render here.
Let me know if you like it!