r/django • • May 12 '26

2026 Django Developers Survey

Thumbnail djangoproject.com
40 Upvotes

r/django • • 40m ago

Help me crosscheck chatgpt

Post image
0 Upvotes

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 • • 21h ago

Yet another task backend

Thumbnail github.com
3 Upvotes

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 • • 1d ago

Apps My small Django job board now labels the jobs that are really AI training work

Post image
3 Upvotes

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?

https://godothire.com/


r/django • • 10h ago

Cree un sistema web en Django

0 Upvotes

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 • • 1d ago

For the last year I was building Citry: a typed Python frontend for Django that's faster and smarter than Django or Jinja templates

Thumbnail gallery
53 Upvotes

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:

  • A component is a Python class with its HTML, CSS and JS, plus a typed class for its inputs.
  • Really fast, faster than Jinja*.
  • Citry catches errors for invalid inputs, typos across the HTML, CSS, and JS, etc.
  • To see the errors in your IDE, install the IDE integration (VSCode). This also adds syntax highlighting.
  • Or run a static check in your CI with a CLI command.
  • Feature-rich and extensible - Python event handlers, supports translations (i18n), caching, CSP, and more.

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 • • 1d ago

Article My Django on the Med 2026 🏖️

Thumbnail paulox.net
8 Upvotes

r/django • • 1d ago

Django-related Deals for Black Friday

Thumbnail adamj.eu
0 Upvotes

r/django • • 1d ago

E-Commerce Backend architecture for the already Frontend website I made before ,sits on free Vercel for now

Thumbnail reddit.com
3 Upvotes

r/django • • 3d ago

Built a prompt engineering workspace with Django 5 & DRF — how are you handling external LLM latency and streaming?

0 Upvotes

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:

  1. Prompt Template & Variable Schema:

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:

  1. Handling LLM Latency in DRF: When waiting 3 to 8 seconds for external model APIs (Anthropic/OpenAI/Gemini), do you prefer standard DRF views with Celery + Redis workers, or have you migrated to Django 5 native ASGI async views (StreamingHttpResponse)?
  2. Token Security: For users who bring their own API keys, what is your preferred pattern in Django — field-level encryption with django-cryptography or vault solutions?
  3. Database Versioning: For prompt iteration history, do you prefer django-simple-history or dedicated versioning tables with parent-child foreign keys?

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!


r/django • • 5d ago

DSF member of the month - Johannes Maron

Thumbnail djangoproject.com
10 Upvotes

r/django • • 4d ago

REST framework Upgrade DRF Auth Kit to 2.0 for a CSRF security fix

5 Upvotes

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 • • 5d ago

2026 Malcolm Tredinnick Memorial Prize awarded to Raffaella Suardini

Thumbnail djangoproject.com
9 Upvotes

r/django • • 5d ago

Templates I'm using a Google translate as an api for my personal project.

0 Upvotes

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 • • 5d ago

Free open-source match centre on Django: how would you model match events?

0 Upvotes
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 • • 5d ago

./tools/provision

0 Upvotes

Do i have to use ./tools/provision everytime I open my localhost or is it all right if I don't?


r/django • • 6d ago

Please join us for Day 2 of Wagtail Space 2026!

Thumbnail gallery
1 Upvotes

r/django • • 6d ago

Components Built with Pure Django, CSS, and JS - Self-contained Template

Thumbnail gallery
3 Upvotes

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 • • 6d ago

A question for interviewers: WHAT DO YOU ASK??!!

8 Upvotes

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:

  • should I ask core Python questions?
  • should I ask Django fundamentals?
  • scenario based questions?
  • tricky Python coding questions?
  • CI/CD/Docker questions?
  • Advanced SQL?
  • JavaScript?
  • AI questions?

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!!!


r/django • • 7d ago

Wagtail Space 2026 kicks off TODAY!

Thumbnail gallery
8 Upvotes

r/django • • 7d ago

Wagtail Space 2026 is TOMORROW!

Post image
7 Upvotes

r/django • • 7d ago

Looking for a Django project to build? DCR now has a panel wishlist

Thumbnail djangocontrolroom.com
4 Upvotes

It's pretty common to see posts here asking about good ideas for projects to build using Django. A great option to this is to build a new tool that other developers can use.

I've collected a wishlist of panels to build for the Django Control Room (DCR) ecosystem that are great for anyone looking to get started building their own open source Django tools:

https://djangocontrolroom.com/panels/wishlist

Some of these are adequate for beginners (settings panel, pip freeze panel, etc.) Others are much larger efforts. Any of them could become something useful that others can use in their projects.

Feel free to tackle any of those projects, join the discord and discuss ideas, or add your own entries into the wishlist (its powered by github issues)

Django Control Room is both a collection of tools and a framework to build tools right inside the Django admin. You can learn more about the project here:

https://djangocontrolroom.com - main site

https://djangocontrolroom.com/build - skills for agents to facilitate building


r/django • • 8d ago

2027 DSF Board Nominations

Thumbnail djangoproject.com
12 Upvotes

r/django • • 8d ago

Apps I Built a site where user created bots Battle each other.

Thumbnail kilobytechess.com
0 Upvotes

A few years ago, Sebastian Lague ran a challenge where people coded tiny chess bots with a strict size limit. I would have loved to enter, but it was already over. So I built a site, with the help of Claude, where you can create your own bot and battle against anyone else who has made one.

https://kilobytechess.com

A few things explaining how it works:

  1. To write a bot, go to the “How to write a bot” page.
  2. There are seven classes of bot, from fifteen lines of code to an open bot with only a ten-megabyte upload limit.
  3. Each bot gets calibrated by Stockfish.
  4. There is analysis for every game played.
  5. You can watch the games live.

Sebastian's Video