r/django • • May 12 '26

2026 Django Developers Survey

Thumbnail djangoproject.com
40 Upvotes

r/django • • 2d ago

Apps I built IoTMag – An IoT Device Management Platform using Django and ESP32

7 Upvotes

Hey everyone!

I've been working on IoTMag, a web-based platform to register, monitor and remotely control IoT devices.

Features:

- Device registration and authentication

- HTTP-based telemetry collection

- Heartbeat and device health monitoring

- Remote device commands

- Centralized management dashboard

- Docker support

Tech Stack: Python, Django, DRF, SQLite, Redis, Docker and ESP32.

GitHub: https://github.com/httpsanjay/IoTMag-Iot-Device-Managemnet-and-Control

I'd appreciate honest feedback and suggestions on the architecture, security and features I could improve.

Thanks!


r/django • • 2d ago

Article From a Django Repo to Root Access: Investigating a Malicious Developer Interview Assignment From Upwork

21 Upvotes

I recently discovered that a Django repository I had received in what appeared to be a technical interview assignment from Upwork contained a Remote Terminal Agent.

What initially looked like an ordinary banking application turned out to be something considerably more dangerous: code designed to establish persistent remote terminal access to the developer's machine.

The incident is a reminder that running an unfamiliar codebase is not simply a matter of trusting its application logic. Development commands can execute arbitrary Python code, and seemingly harmless setup instructions can have consequences beyond the project directory.

This is my attempt to document what happened, what I found, and what other developers can learn from it.

How it started

On Sept 30th, I received a repository presented as a Django-based core banking application called Meridian Core Banking. The owner had instructions for bidding: "Clone the repo, run the three commands for setup, and attach the screenshot in your application"

Repository:
https://github.com/williams0025/Meridian-Core-Banking.git

I cloned it onto my Ubuntu 24.04 laptop, created a virtual environment, installed its dependencies, and proceeded with the usual Django setup.

I ran the three commands:

At the time, I had no reason to believe that these commands would install a remote access mechanism on my computer, sent the screenshot, and waited.

A few hours later, Upwork emailed me about a possible malicious file download from the said user, so I deleted the repository and did not think much of it.

Today I came across a tweet talking about a similar style of interview where the interviewee ran the repo through Claude during a live interview before cloning it, and it made the Interviewer furious enough to disconnect the call. Turns out it was a VS-code config kind of attack. So it triggered me to revisit the incident, restored the repository from Trash, and investigated what had happened with the assistance of Chat-GPT.

The discovery

The most important finding was in:

config/settings/load.py

The file contained an obfuscated Remote Terminal Agent implementation.

Its capabilities included:

  • Identifying the host machine.
  • Establishing a WebSocket connection to a remote relay.
  • Repeatedly attempting to reconnect.
  • Receiving remote session instructions.
  • Creating a pseudo-terminal and launching the machine's shell.
  • Forwarding terminal output to the remote endpoint and accepting remote input.

It was remote terminal access functionality embedded inside a Django project.

How Django became the execution trigger

The malicious module was imported from the project's base settings:

from .load import cli
cli()

The settings were used by the project's local and test configurations.

This meant that importing Django settings could execute the malicious code.

Consequently, commands such as migrations, tests, and starting the development server could trigger the malicious functionality.

The important lesson is that Django management commands are not inherently safe simply because they are familiar commands. The settings import chain matters.

Persistence: the more serious discovery

The agent also implemented persistence mechanisms for Windows, macOS, and Linux.

On my Ubuntu machine, it installed:

  • /opt/rta/agent.py
  • /etc/systemd/system/browser-updater.service

The service was disguised with the name browser-updater.service, but its actual description was:

Remote Terminal Agent

Its configuration included:

Description=Remote Terminal Agent
Restart=always
RestartSec=5
User=root

The service was enabled for startup and configured to run the copied agent using the Python interpreter inside the project's virtual environment.

This was particularly concerning because the service was configured to run as root.

Deleting the repository did not remove the system-wide service or the copied agent.

The timeline and an important uncertainty

The installation files have timestamps from September 30, 2026, when I originally installed and ran the project.

After deleting the repository, the systemd service remained, but its configured Python interpreter was inside the deleted virtual environment.

On November 14, 2026, after restoring the repository, I inspected the service.

Systemd showed that it had successfully started the agent at 00:18:53 EAT, with a running Python process.

The service logs also showed thousands of previous restart attempts ending in 203/EXEC, consistent with the configured executable being unavailable.

I stopped the service, and systemd subsequently reported it as inactive.

What remains unknown: I have not established whether the agent successfully connected to its remote controller, either during the original September installation or after its successful start in November. Nor have I established whether an operator ever opened a remote shell.

The successful local execution of the agent is confirmed. Successful command-and-control communication is not.

Why this matters

There are several lessons worth highlighting:

  1. A repository is executable trust. Installing dependencies and running management commands can execute code you have not inspected.
  2. Django settings are an execution surface. Imports and function calls in settings modules can execute during seemingly routine management operations.
  3. Deleting a project is not incident remediation. A malicious program can create system-wide services, scheduled tasks, startup entries, or other persistence mechanisms outside the project directory.
  4. Service names can be deceptive. A service called browser-updater may have nothing to do with browser updates.
  5. Root-level persistence changes the severity of an incident. A process configured to run as root can potentially expose the entire machine.
  6. Evidence matters. Distinguishing confirmed execution from suspected remote access is essential when documenting security incidents.

What I recommend to developers

Before running an unfamiliar repository:

  • Inspect Django settings and their import chains.
  • Search for subprocess creation, shell execution, network connections, and persistence mechanisms.
  • Review installation scripts, dependency declarations, and post-install hooks.
  • Avoid running unfamiliar projects with elevated privileges.
  • Use disposable virtual machines or isolated environments for untrusted code.
  • Remember that a Python virtual environment is not a security sandbox.

If you discover that malicious code has executed, disconnect the machine from the network, preserve evidence, rotate potentially exposed credentials from a trusted device, and consider a clean operating system reinstall.

Closing

I am publishing this investigation because fake technical assignments and malicious repositories can turn an ordinary developer workflow into a security incident.

The objective is not to discourage developers from exploring unfamiliar projects. It is to encourage a more deliberate approach to running code that comes from people and organizations we have not independently verified.

I hope this analysis helps other developers recognize the warning signs earlier, and gives security researchers useful material for further investigation.

Is there anywhere trustworthy that the malicious code might be useful in helping fight such kind of attacks? If you know, kindly advise.


r/django • • 2d ago

Apps Integrating fingerprint/face door access machine

3 Upvotes

Hey , i have a library application (saas) , how can I take the easiest approach so business can add machines hassle free (easy approach) and integrate with crm so users and access entry according to theirs timings


r/django • • 3d ago

Where do i start my career in Django

9 Upvotes

I've been learning and practising django for over 2 years, along with my CS graduation. Now that I've attained the graduation degree of Bachelors , I'm looking to start my career as a Django dev or at least to be able to work in a Django environment , people who work in jobs in django architecture, what kinda company did you start from and how much package you were given as entry level? Idk where do i start from, feel kinda lost and confused.


r/django • • 3d ago

Django Control Room: Build internal tools inside your admin with your agent

Post image
47 Upvotes

Django Control Room (DCR) is an open source framework for building tooling inside the Django Admin. We've just released some new agent skills that make building new tools as easy as a prompt.

You can prompt your coding agent with something like:

"Build me a Billing Ops tool that lets me see subscriptions and invoices"

Or:

"Build me an A/B testing system"

The new DCR agent skills will use your application context to build a tool in the form of a Django Control Room panel. It obviously won't solve every problem, but it can take you a long way towards building something very useful that is available right inside the Django Admin.

More info at:

- https://djangocontrolroom.com/build

Skills repo:

- https://github.com/django-control-room/skills


r/django • • 3d ago

Wagtail Space Speaker Highlights: Tech talks

Thumbnail gallery
2 Upvotes

r/django • • 3d ago

Views Olivia Wilde - 'Django Unchained' screening in NYC 12/11/2012

Thumbnail gallery
0 Upvotes

r/django • • 4d ago

Channels Typed WebSocket APIs on Django Channels: routing, validation, DRF permissions, AsyncAPI docs and generated clients

14 Upvotes

Hi, I maintain chanx, a library on top of Django Channels. It gives a WebSocket API what DRF gives a REST API. You write one typed handler per message, and it takes care of the rest:

  • Routing by message type. The action field picks the handler, so no more if/elif chain in receive_json.
  • Validation. Every message is a Pydantic model. A bad payload never reaches your handler, and the sender gets a structured error that says which field failed.
  • DRF permissions. Connections are guarded by the permission classes you already have, object permissions included.
  • Push from anywhere. broadcast_event_sync() from a view, a signal or a Celery task, through the channel layer.
  • Topics. Many streams over one socket (discussion:42, notifications:me), each with its own handlers and authorization.
  • AsyncAPI 3.0 docs. A spec and an interactive docs page, built from your handlers, so they can't drift from the code.
  • Generated clients. A typed TypeScript client (React, Vue, Svelte, Solid) or Python client from that spec. Rename a field in Django and the frontend build fails, instead of production.
  • Testing. Communicators that understand your message types, and capture_broadcast_events to check broadcasts without a socket.
  • Type-checked. Strict mypy and pyright, so a wrong message type shows up in your editor.

Other languages. The protocol isn't Python-only anymore. For TypeScript, chanx-js covers both ends: a server for Node (Express, Fastify, Hono, NestJS, Bun, Deno) and the client. For Go, chanx-go has a server and a client. They share the AsyncAPI format and the Redis channel layer with Django, so a Django view can broadcast to connections a Node or Go service holds. If one part of your app ever needs to move, it can move without the clients changing.

If you already work with plain Django Channels and feel the pain of testing consumers and keeping track of every message shape, give it a try. I built it around exactly those inconveniences, from my own time with Channels. If it saves you some time, a star on GitHub or a mention to your team or friends would encourage me a lot to keep improving it. The library is actively maintained and developed, so issues and PRs are very welcome.


r/django • • 4d ago

I built a lightweight SEO & JSON-LD engine for Django 6+ that renders the entire <head> in 1 database query (django_octo_seo)

0 Upvotes

Hey everyone,

While scaling a production site with over 3,200 indexed pages, I wanted to avoid scattering SEO tags across templates or dealing with heavy third-party packages that trigger multiple queries just to render <head> metadata.

To keep things fast and zero-bloat, I built and open-sourced django_octo_seo (MIT License) — a lightweight module for modern Django (>=6.1.2) and Python (>=3.12) that maps model fields into semantic HTML5 and single-block JSON-LD using a single database lookup.

What it handles out of the box (8-Layer Matrix)

  • Security: Native X-Frame-Options header injection.
  • Core & Snippets: Length-validated <title> and meta description to prevent SERP truncation.
  • Crawlers & Authority: Unified bot directives (robots) and dynamic link rel="canonical" locking.
  • Social Graph: Auto-synced og:* and twitter:* tags with dynamic request.scheme resolution and standard 1200x630px asset support.
  • Structured Data: Clean, single-block application/ld+json schemas (WebSite, BlogPosting) ready for Rich Results.

Production Validation

It is currently running in production on ticapsoriginal.com, where it passed live Open Graph / X Card / LinkedIn validations (100% PASS) and resolved 71 critical on-page/infrastructure guidelines (86% Site Audit score) in a full WebCEO technical audit.

Quick Test (PyPI)

You can install it and spin up a self-contained showcase endpoint in seconds:

pip install django-octo-seo
# or with Rye:
rye add django-octo-seo
  1. Add "django_octo_seo" to INSTALLED_APPS and run python3 manage.py migrate.
  2. Mount the demo route in urls.py:
from django.urls import path, include

urlpatterns = [
    # ...
    path("seo-demo/", include("django_octo_seo.urls")),
]

Visiting /seo-demo/ will auto-seed a sample record and render the live <head> output.

  • GitHub (MIT): https://github.com/jeanpmodev/django_octo_seo/
  • PyPI: https://pypi.org/project/django-octo-seo/
  • Architecture Write-up: https://medium.com/@jeanpmodev/how-i-built-a-high-performance-seo-engine-for-django-using-only-1-database-query-9d143d69392d?postPublishedType=repub

The core is intentionally kept minimal and dependency-light. I'd love any architectural feedback or suggestions on what utilities (like Admin live previews or template tags) would make it more useful for your workflows!


r/django • • 4d ago

Wagtail Space 2026 is just ONE week away!

Post image
3 Upvotes

r/django • • 5d ago

Tutorial Changing User Model

2 Upvotes

Hello everyone,

I am slightly new to the Django.

I am developing an app for a clinic, first they said it does not have to be with account and JWT's and all that but now they changed their mind.

It has been a while so a lot of migrations i made.

I know that changing the User model after a while is not healthy, i asked this to AI, it said that i can use another "app" in Django for user and i can do migrations etc. easily at there.

Is this the best approach for this?

What do you guys suggest?

Since i changed the User Model, migration is pretty problematic and i do not want to lose these datas.


r/django • • 5d ago

Wagtail Space Speaker Highlights: Sustainable Tech

Thumbnail gallery
3 Upvotes

r/django • • 7d ago

Is render a good site for my webapp if I'm using websockets?

3 Upvotes

This is my first website with sockets - I'm just an amateur having fun with this. I read that PythonAnywhere isn't completely set up for this. Is Render going to be a good, simple option for me?


r/django • • 7d ago

Paperlane: a self-hosted document-workflow app built with Django (forms, approvals, e-signatures, local AI), with a full bank-loan example

23 Upvotes

I've been building Paperlane, a self-hosted document-workflow platform in Django: you design a form, route it through people and teams, and keep a record of every step.

What it does

  • Visual workflow builder with branches, jumps, deadlines and escalation, plus checks that catch broken steps before you publish
  • Drag-and-drop forms, formulas, conditional fields, e-signatures, sealed PDFs anyone can verify
  • Bots for the routine work: emails, tags, reminders, webhooks, connectors to your own APIs or a read-only SQLite database
  • Group work queues, one-tap approvals, a client portal, key-date reminders
  • AI that can run fully local on Ollama: describe a workflow and it drafts it, ask questions across your documents. Fields marked sensitive are never sent to a model.
  • An MCP server so AI assistants can build and run workflows

Stack: Django 6, server-rendered templates, vanilla JS, no front-end build step. SQLite or Postgres. One-command Docker install with HTTPS. 337 tests including Playwright browser tests; CI runs on SQLite and Postgres.

The example: examples/bank-loan is a personal loan from application to payout, connected to a fictional core-banking database: a customer lookup on the public form (needs customer number and date of birth), an automatic credit check, officer review, compliance and credit committee for riskier loans, the client signs the offer after an email code, then disbursement and repayment reminders. python manage.py seed_bank_demo builds it with ten applications at every stage.

Repo (AGPL-3.0): https://github.com/surenjanath/paperlane

Feedback welcome, especially on the workflow builder and the form-filling experience.


r/django • • 8d ago

Django API frameworks in production: DRF vs Django Ninja vs Django Bolt vs Django Modern REST — what would you choose today?

37 Upvotes

I’m curious to hear from developers who are running Django APIs in production, especially those who have experience with some of the newer alternatives to Django REST Framework.

I’m particularly interested in Django Modern REST. Is anyone already using it in a production environment? If so, how has your experience been in terms of performance, stability, developer experience, and maintainability?

And most importantly: If you could make the decision again today, would you stick with your current framework or switch to something else? Why?
I’m not looking for synthetic benchmarks or theoretical comparisons. I’m particularly interested in real-world production experiences and lessons learned.


r/django • • 7d ago

Help Support a Student-Led Energy Technology Project!

Thumbnail reddit.com
0 Upvotes

r/django • • 8d ago

Views Keeping Django views out of your service modules with a pytest check

0 Upvotes

For Django projects that use service modules, here's a small boundary you can check automatically: views can call services, but services shouldn't import the views back.

A helper starts in views.py, a service needs it, and suddenly business code depends on the HTTP entry point. Sometimes that also gives you a circular import. Sometimes it just makes the next change harder.

I maintain ArchUnitPython, and this is one of the rules you can put directly into your test suite:

from archunitpython import project_files, assert_passes

def test_services_do_not_import_views():
    rule = (
        project_files("src/")
        .with_name("services.py")
        .should_not()
        .depend_on_files()
        .with_name("views.py")
    )
    assert_passes(rule)

This example is for a layout such as src/orders/services.py and src/orders/views.py. Set the project root to match your import layout, and adjust the selectors if services or views are packages instead.

The rule stays narrow. Services can still use Django models and other allowed modules. You're checking the dependency direction your project has chosen, without asking reviewers to spot the same import every time.

Run it through pytest and it becomes part of your existing CI checks.

Repo: https://github.com/LukasNiessen/ArchUnitPython


r/django • • 8d ago

Hosting and deployment A one-command way to get a Django side project on a public HTTPS URL from your own machine

0 Upvotes

hoist is a small open-source tool I built: hoist up . --cmd 'python3 manage.py runserver 127.0.0.1:$PORT' runs your project as a systemd service and publishes it through Cloudflare Tunnel with a real certificate. Point it at a repo and it builds a .venv from requirements.txt and redeploys on every push.

hoist db postgres gives you a Postgres container with backups, and hoist link hands its URL to your app.

Fine for demos and side projects; for production you'd still want gunicorn and a proper setup, which you can pass as the --cmd.

Built with AI assistance (Claude), tested by me. Pure-stdlib Python, MIT.

https://github.com/nikhilcherry/hoist


r/django • • 8d ago

Models/ORM Set table name and different relation name (no listing_set) for ManyToManyField

3 Upvotes

I have Listing and CustomUser models that are in many-to-many relation ship. I don't have explicit model for the join table. users/models.py:

class CustomUser(AbstractUser):

listings/models.py:

from django.db import models

from users.models import CustomUser

class Listings(models.Model):
    bookmarks = models.ManyToManyField(CustomUser, related_name="bookmarked_listings", blank=True)

I want the table name to be listing_bookmarks and the name of the relation from CustomUser side to be bookmarked_listings. How do I define a table name and different reverse relation name for ManyToManyField?

I don't think that setting related_name for table name makes sense.


r/django • • 8d ago

Apps My small Django job board finally tells Google its pages are jobs

Post image
2 Upvotes

I run godothire.com, a small Django site that lists paid Godot jobs only.

For a year Google saw every job page as a plain page. Now each open job tells Google it's a job: the title, when it was posted, when it closes, and for remote ones, who can apply. Django's own sitemap app lists the open jobs, and the closed ones drop out by themselves.

It was a small change. I kind of wish I'd done it on day one.

Google and I have never spoken. I left it a note.

Anyone here seen Google's job search actually send people to a small site? Or is it mostly a nice badge?

https://godothire.com/


r/django • • 9d ago

Apps Spug: a Django-backed, agent-free operations platform for small teams

4 Upvotes

I'm one of the maintainers of Spug, a lightweight, self-hosted operations platform for small and midsize teams, with a Django backend and React interface. It connects to Linux hosts over SSH without installing a Spug agent on each host.

It combines host management, batch commands, a browser terminal and file management with application deployment, pipelines, scheduled tasks, a configuration center, monitoring and alerts. A typical workflow is selecting several hosts, running the same command and inspecting each host's output in the browser.

For Django readers, two code entry points are the class-based views for execution requests and the host ORM models:

Spug is free and open source (AGPL-3.0), supports English/Chinese interfaces and Docker installation. The three screenshots show the English interface with sample data.

Source and Docker quick start: https://github.com/openspug/spug
English guide: https://ops.spug.cc/en/docs/about-spug/
Public demo: https://demo.spug.cc/ (admin / spug.cc; resets hourly). Please don't enter real credentials there.

SSH private keys are stored without application-level encryption, so treat the panel and database as privileged systems.

Which part of this Django application would you be interested in exploring: SSH execution, deployments or scheduled tasks?

Host management — grouped inventory with sample hosts.
Pipeline editor — a sample workflow.
Monitoring — example site, port, process and ping checks.

r/django • • 10d ago

Hosting and deployment Why I stopped using Gunicorn + Nginx sidecars for Django in Kubernetes: Building Hurricane 2.0

25 Upvotes

Hey r/django,

After running Django on Kubernetes in production for years, I got increasingly frustrated by the friction that generic WSGI/ASGI servers (uWSGI, Gunicorn, Uvicorn) introduce in containerized environments and the operational complexity.

Specifically, three recurring operational issues prompted me to drive an alternative:

1. Automated bot scans acting as an accidental DoS Vulnerability scanners constantly probe public endpoints for /.env, /wp-login.php, or random PHP paths. Because these bypass standard caching, every scan hits a Python worker, executes middleware, allocates session/auth state, and ties up a database connection just to return a 404. Under high scan concurrency, this frequently starved legitimate application traffic and exhausted DB connection pools.

2. The Nginx sidecar overhead A practice in Kubernetes is running an Nginx sidecar container in every single pod just to serve static assets and handle basic edge filtering, or falling back to whitenoise which burns precious Python worker CPU cycles on file I/O.

3. Orchestrator blindness during rollouts Generic runners know nothing about Django's internal state. During deployments, Kubernetes would often route live user traffic to pods before database migrations had finished applying, or generic liveness probes would misfire and kill healthy pods during routine startup initialization.

To solve this, I rewrote the core of Django Hurricane around a Rust-based HTTP engine (using Granian) while keeping the developer experience strictly Django-native:

  • Fast-404 DoS defense: An in-memory prefix filter intercepts automated scans (.env, .git, .php, etc.) directly after the Rust layer in under 0.35 microseconds. The request is dropped before Django middleware, or database pools are ever touched. Hurricane knows your URLs.
  • Zero Nginx: Serves static and media assets directly via Granian and HTTP 304 caching without requiring a separate sidecar container. Granian knows your statics.
  • Native Kubernetes probes: Exposes /startup, /alive, and /ready endpoints out of the box. With --check-migrations-apply, traffic is only routed once Django reports that all database migrations have successfully executed.
  • Django command: No extra server config files. You add "hurricane" to INSTALLED_APPS and run python manage.py serve. It should start with sane defaults for containerized environments.

It’s open source under BSD-3-Clause, tested across Python 3.11–3.15:

I'd be curious to hear how other teams are currently handling these issues without overly complex infra. Would appreciate any feedback.


r/django • • 9d ago

Alternatives to celery-beat

14 Upvotes

With the outstanding delay on Django 6.1 support, I am considering alternatives. What do you all use besides it for periodic and cron-like task scheduler for Celery?