Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
Python & Django

What to Check Before and After Launch

Last updated:

The defaults do a lot

Django protects against injection through the ORM, escapes template output by default, includes cross-site request forgery protection and provides sensible password hashing.

Most Django vulnerabilities are in code that worked around the defaults: raw SQL with string formatting, marked-safe template output, or exempted CSRF views.

What still needs your attention

  1. Authorisation — record-level access, which Django does not provide
  2. File uploads — where they are stored and how they are served
  3. Dependencies — audited automatically on every build
  4. Production settings — debug, hosts, cookies, HTTPS
  5. Secrets — out of the repository, rotated

Where the defaults get bypassed

BypassRisk
Raw SQL with string formattingInjection
Marking user content as safeCross-site scripting
CSRF exemption on a viewRequest forgery
Serving media from the code directoryCode execution
Disabling checks to make something workWhatever they protected against

Each of those has a legitimate use and each should be an explicit, reviewed decision rather than a convenience.

Run the built-in check

Django includes a deployment check that reports on production configuration. Running it before launch catches the common misconfigurations in seconds.

It should be part of the deployment pipeline rather than something someone remembers to run.

Test authorisation adversarially

  • Two accounts trying to reach each other's records
  • Direct URL access with another user's identifiers
  • Exports and API endpoints, not just screens
  • Admin access, which is powerful and frequently over-granted

Frequently asked questions

Is Django secure by default?

Against the common web vulnerabilities, largely. Your authorisation logic and configuration are where the remaining risk sits.

How often should we audit dependencies?

Automatically on every build. Security updates applied within days.

What about the admin?

Powerful, and access should be restricted to those who need it. Log and review admin actions.

Do we need a web application firewall?

As an additional layer it adds value. It is not a substitute for the checks above.

Keep reading

Never run the deployment check?

It takes seconds and it catches the common production misconfigurations. Worth doing today.

Book a free 30-minute call Get a project estimate WhatsApp us

Related services

What we build for problems like this one

Custom Software DevelopmentWeb DevelopmentMachine Learning