r/django • u/jcjudkins • 5h ago
Events DSF Board Nominans are up!
forum.djangoproject.comYou don't have to be aDSF member to apply!
r/django • u/jcjudkins • 5h ago
You don't have to be aDSF member to apply!
r/django • u/hayyat37 • 11h ago
Check my code on GitHub: github.com
I built this Django project and pushed it to GitHub!
r/django • u/Secure-Composer-9458 • 20h ago
I run a Django + Channels app with two Celery workers and beat on one VPS, each as its own systemd service. It took me a while to get the unit files right, so here's what's in them in case it saves someone the trial and error.
For every process:
For the web process:
For Celery:
For scale: web is around 320 MB, each worker around 280 MB and beat around 140 MB.
Full disclosure, these units come out of a deploy tool I'm building, so I've stared at them more than is healthy. Happy to paste a full unit file in the comments if anyone wants one.
What's in your unit files that you'd never run without?
r/django • u/yassi_dev • 3d ago
Recently I shared about new AI tools to build DCR panels (internal tools that live in your admin) as well as a wishlist for things that haven’t been built yet.
Now, a wishlist idea has been built entirely by a community member.
dj-file-browser-panel is a read-only browser for local files in Django admin.
https://djangocontrolroom.com/panels/dj-file-browser-panel
If you’re looking for something to build with Django, take a look at the other ideas on the wishlist.
r/django • u/NebulaKaiz • 3d ago
I'm trying to figure out when celery actually needs its own vm. Right now django postgres redis and two celery workers are on one 4 vcpu 8 gB box. Usually its fine but then someone uploads a csv with a million rows and the whole app slows down until celery finishes. First time it happened i almost resized the server but ten minutes later everything was normal again. I could move celery to another vps. Serverspace hetzner and others make that easy enough but then i have another server to maintain for a problem that happens a few times a week. Idk if i should wait until this becomes a daily problem or split it now before someone uploads an even worse file?
r/django • u/user5034999999 • 3d ago
Help me crosscheck chatgpt below is the code
function call_in_span(
span: Sentry.Span | undefined,
args: AjaxRequestHandlerOptions,
): JQuery.jqXHR<unknown> {
// Remember the number of completed password changes when the
// request was initiated. This allows us to detect race
// situations where a password change occurred before we got a
// response that failed due to the ongoing password change.
const orig_password_changes = password_changes;
// Wrap the error handlers to reload the page if we get a CSRF error
// (What probably happened is that the user logged out in another tab).
const orig_error =
args.error ??
(() => {
// Ignore errors by default
});
args.error = function wrapped_error(xhr, error_type, xhn) {
/* istanbul ignore if */
if (span !== undefined) {
Sentry.setHttpStatus(span, xhr.status);
span.end();
}
if (reload_state.is_in_progress()) {
// If we're in the process of reloading the browser,
// there's no point in running the error handler,
// because all of our state is about to be discarded
// anyway.
blueslip.log(`Ignoring ${args.type} ${args.url} error response while reloading`);
return;
}
if (xhr.status === 401) {
if (password_change_in_progress || orig_password_changes !== password_changes) {
// The backend for handling password change API requests
// will replace the user's session; this results in a
// brief race where any API request will fail with a 401
// error after the old session is deactivated but before
// the new one has been propagated to the browser. So we
// skip our normal HTTP 401 error handling if we're in the
// process of executing a password change.
return;
}
if (page_params.page_type === "home" && page_params.is_spectator) {
// In theory, the spectator implementation should be
// designed to prevent accessing widgets that would
// make network requests not available to spectators.
//
// In the case that we have a bug in that logic, we
// prefer the user experience of offering the
// login_to_access widget over reloading the page.
spectators.login_to_access();
} else if (page_params.page_type === "home") {
// We got logged out somehow, perhaps from another window
// changing the user's password, or a session timeout. We
// could display an error message, but jumping right to
// the login page conveys the same information with a
// smoother relogin experience.
window.location.replace(page_params.login_page);
return;
}
} else if (xhr.status === 403) {
if (xhr.responseJSON === undefined) {
blueslip.error("Unexpected 403 response from server", {
xhr: xhr.responseText,
args,
});
} else if (
z.object({code: z.literal("CSRF_FAILED")}).safeParse(xhr.responseJSON).success &&
reload_state.csrf_failed_handler !== undefined
) {
reload_state.csrf_failed_handler();
}
}
orig_error(xhr, error_type, xhn);
};
const orig_success =
args.success ??
(() => {
// Do nothing by default
});
args.success = function wrapped_success(data, textStatus, jqXHR) {
/* istanbul ignore if */
if (span !== undefined) {
Sentry.setHttpStatus(span, jqXHR.status);
span.end();
}
if (reload_state.is_in_progress()) {
// If we're in the process of reloading the browser,
// there's no point in running the success handler,
// because all of our state is about to be discarded
// anyway.
blueslip.log(`Ignoring ${args.type} ${args.url} response while reloading`);
return;
}
orig_success(data, textStatus, jqXHR);
};
return $.ajax(args);
}r/django • u/Scary-Ad-7645 • 4d ago
Estoy desarrollando un sistema web en django ,que combina inteligencia Artificial predictiva con herramientas de acompañamiento académico para mantener a los estudiantes comprometidos y activos hasta la graduación.
r/django • u/cheatingjoe • 4d ago
Howdy y'all, 🤠
If you're looking to switch to Django's task framework, now is as good a time as ever.
Jokes aside, though, as mentioned on the DjangoChat podcast, I mainly build a durable backend with very high I/O throughput. To send emails, dispatch webhooks or VoIP calls. Since then it has been deployed in a growing number of production projects. But I'd love to get more input from people tackling other use cases.
So please do share your experience. 💚
Cheers!
-Joe
r/django • u/Advanced_Ad745 • 4d ago
I run godothire.com, a small Django site that lists paid Godot jobs only.
Some "Godot developer" posts were really AI training work: you help train or test an AI model, not ship a game. Paid, so they stay. But applicants wanted to know before clicking, which is fair.
So each job now checks its title and description against a short list of phrases, and the list and job pages show an "AI training" badge when one matches. A model property and an if in the template, basically.
The tricky part was keeping normal game AI out of it. Every game has an AI. Most of them just walk into walls.
Anyone here done this kind of labelling with something smarter than a word list?
r/django • u/JuroOravec • 5d ago
This week I released Citry v1.0, a fast and powerful frontend framework for Python. You can now build Django apps with the same speed, convenience and tooling you're used to in Vue or React, without a separate JavaScript project.
To get a feel for it, see the intro tutorial.
Overview:
Django integration:
Coming from django-components? There's a migration guide: https://citry.dev/guides/migrate-from-django-components/
Links:
Next steps:
I want to make Citry the go-to frontend for Django apps, to make the Django ecosystem a safer (less buggy) place. Please share and promote this project.
If you want help trying out Citry in your Django project, reach out to me here, Discord, or email.
For any questions or missing features, visit our Discord.
PS:
Citry is the successor to django-components. Citry was in development for a year, sponsored by Hendrik Richter and OhneMakler Österreich GmbH. Thank you to everyone who supported the project ❤️
* Measured from a request to a user click.
r/django • u/akashramanni • 5d ago
r/django • u/LavishnessBig5076 • 6d ago
Hey everyone,
Over the past few weeks, I have been building an open prompt workspace and chaining platform called EvokeBase using Django 5 and Django REST Framework (DRF) on the backend, paired with a React 18 + Vite frontend.
Most LLM wrappers in tutorials use FastAPI or Node, but I wanted to explore how far we can push Django 5's modern async capabilities and DRF viewsets for production-ready AI workflows.
Backend Architecture & Stack:
- Framework: Django 5.x + Django REST Framework (DRF)
- Authentication: JWT via djangorestframework-simplejwt (with refresh token rotation and blacklisting)
- Database: SQLite (local dev) / PostgreSQL (production)
- Frontend: React 18, Tailwind CSS, Framer Motion
- Hosting: Vercel (Frontend) + Cloud backend
Key Django Design Patterns Used:
Instead of storing raw text and parsing on every request, we store template metadata and extract {{variable}} slots client-side with debounced regex, passing structured payloads to DRF serializers.
2. Context Injection Pipeline:
Built custom service layers where project-specific tone parameters (target audience, formatting constraints, banned keywords) are automatically merged into the system prompt payload before dispatching to model endpoints.
3. Multi-Model Chaining Logic:
Orchestrated an asynchronous pipeline where Node 1 output (e.g. Gemini extracting structured JSON) feeds directly as typed context into Node 2 (e.g. Claude drafting long-form copy).
Questions for the Django Community:
As the platform scales, I would love to learn from your production experiences:
If you would like to test the live UI and responsiveness, you can check it out here:
Live Demo: https://www.evokebase.com
Would love any feedback on the architecture, API design, or Django-specific optimizations!
Hi all, DRF Auth Kit recently got a report of a medium-severity CSRF vulnerability (GHSA-rhm3-f8xp-7wgv). If you use it with cookie authentication, we suggest upgrading to 2.0.0 so the problem can't affect your production.
In detail: before 2.0, JWTCookieAuthentication and TokenCookieAuthentication did no CSRF check. Another page could make a logged-in user's browser send requests as them, like changing their profile, password or MFA settings. With AUTH_COOKIE_SAMESITE = "None", any site could do this. With the default "Lax", a page on a sibling subdomain still could. Requests that use the Authorization header are not affected.
2.0 rejects cookie-authenticated POST/PUT/PATCH/DELETE requests with a 403 unless they come from the same origin or from an origin listed in CSRF_TRUSTED_ORIGINS. Mobile apps and server-side clients don't send these browser headers, so they keep working.
Breaking change for SPAs: if your frontend runs on a different origin than your API (e.g. app.example.com calling api.example.com), add it to your settings or its write requests will get a 403:
CSRF_TRUSTED_ORIGINS = ["https://app.example.com"]Remember local dev too: localhost:5173 calling localhost:8000 is also a different origin.
CSRF_TRUSTED_ORIGINS += ["http://localhost:5173"]If your frontend and API share the same origin, no change is needed. You can turn the check off with AUTH_COOKIE_ENFORCE_CSRF = False, but with SameSite=None that brings the vulnerability back.
Full details are in the docs.
r/django • u/Profil-Software • 8d ago
Hey. We built OpenMatchroom, a free tool for football clubs (MIT), at Profil Software. Django handles clubs, line-ups and match events, plus a live console that pushes goals, cards and subs to the public page. Branding per club comes from config.
Would you model the events differently? What would you add? Let us know what you think.
https://open-matchroom.profil-software.com/r/django • u/Cold_Bake_5149 • 8d ago
I'm using a Google translate as an api for my personal project. The issue I find is for a given description the text doesn't always translate its like my ip gets blocked , how do I resolve this , fallback api , I don't want to pay money for external translation api , suggest methods...
r/django • u/user5034999999 • 9d ago
Do i have to use ./tools/provision everytime I open my localhost or is it all right if I don't?
r/django • u/osmium_2259 • 10d ago
Hi all,
I recently became aware of Django's inclusion_tag and then found a blog post discussing its use in making template components.
This intrigued me, and I had the idea of combining the inclusion_tag with a single Django template, containing all the markup, styles, and behavior. Thus, I created a demo to test these ideas, resulting is an interactive sidebar menu built with pure CSS and JS, powered by Django's inclusion_tag—all without third-party libraries.
I wanted to isolate the component styles to prevent clashes with surrounding elements, and that's when I found inline scoped CSS. I actually managed to style the whole component without using any class selectors (thinking of class names is a pain), thanks to CSS scoping and nesting.
To make the component interactive, I just included an inline vanilla JS script at the bottom.
For me, this project really demonstrates two main ideas: the use of inclusion_tag to create components and the power of modern inline CSS to help create self-contained components.
Of course a component can be built with more than just pure CSS/JS. Tailwind, Bootstrap, Alpine, HTMX, etc. should all work great to create components.
If you're interested, check out the repo here: https://github.com/osmium2259/django_builtin_components_demo.
Curious what you all think about these ideas I've been bouncing around!
r/django • u/meet-me-piya • 10d ago
Hello everyone, I'm pretty new to taking interviews for experienced folks. I would like some help or suggestions as to what kind of questions you ask to experienced folks, preferably 2-5 years. I'm curious:
Can someone help me please? Especially in this AI era, anyone can do everything with the help of AI so how to assess candidates??
PLEASE HELP!!!