Skip to main content
ProductsDesktop toolsTASTECADDrawing reviewTASTEFILESFile managementTASTEFTPFile transferTASTESSHRemote workspaceTASTEZIPCompression and extractionTASTEWINMFile managementDeveloper toolsTASTECODERust integrated development environmentTASTESTUDIOIntegrated development and test environmentTASTEETLData integration (ETL)ServersTASTEREMOTERemote desktop serverTASTEGEOGeospatial serverTASTEMAILMail workspaceInvestingTASTESTOCKStock auto-trading desktop appGet startedDownloadsDocumentationBuyAll products
Marketplace
News
TechNewsToday's dev newsDeveloper docsProgramming languagesRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp & desktop frameworksTauriFlutterReact NativeElectronAlgorithmsAlgorithm basicsCore algorithmsAdvanced algorithmsPractical algorithms
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcaseCommunity guide
Work with usTech transferWebsite buildDesktop app buildRelease and payment pipelineSales partnerContact
ServicesRemote desktopCustom installer packages
TASTEDEV
Products

Desktop tools

TASTECADComplex drawings, opened with easeTASTEFILESJust the files you need, as fast as possibleTASTEFTPThe tidiest path for your filesTASTESSHA stronger link between you and your serversTASTEZIPPack faster, unpack saferTASTEWINMA keyboard-first file manager with two panes

Developer tools

TASTECODEEdit, build, debug and test Rust apps in one windowTASTESTUDIOFrom editing to remote tests and approved AI fixesTASTEETLMove data while you watch the values

Servers

TASTEREMOTEA remote desktop you run on your own serverTASTEGEORebuilding a GeoServer-compatible geospatial server in RustTASTEMAILTake back control of your email

Investing

TASTESTOCKStock auto-trading that follows the rules you set: when, and what

Get started

DownloadsLatest builds of every productDocsHow to use each productBuySubscriptions and perpetual licencesAll productsEvery product at a glance
All products
MarketplaceNews
Tech

News

Today's dev newsOfficial announcements on languages, frameworks, GitHub and AIDeveloper docsGuides to languages, frameworks and algorithms

Programming languages

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App & desktop frameworksTauriFlutterReact NativeElectron

Algorithms

Algorithm basicsComplexity analysis · Sorting · Searching · Basic data structures · Trees and heapsCore algorithmsGraph traversal · Shortest paths & minimum spanning trees · Dynamic programming · Greedy algorithms · Divide and conquer · BacktrackingAdvanced algorithmsString algorithms · Math and number theory · Bit manipulation · Segment trees · Union-findPractical algorithmsCoding interview strategy · LRU cache · Rate limiting · Consistent hashing
All development docs
Community
ProjectsDiscover builders and their workDevelopment logsDecisions and lessons learnedPromptsReusable instructionsAI tool issuesProblems and workarounds for Claude, Codex, GeminiShowcaseFinished resultsCommunity guideHow we build in the open
Work with us
Tech transferNative apps in Rust and eguiWebsite build10 languages, accounts, docs and downloadsDesktop app buildRust and egui, no WebViewRelease and payment pipelineSigning, MSI, deb, rpm, AppImage, hashesSales partnerRecommend us and earn 30%ContactBuilds, partnerships and investment
Services
Remote desktopReach your computer from a browserCustom installer packagesOnly the features you need, settings preloaded
Buy
EN
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Log in
Log in
TASTEDEV

From small tools to better development.

support@tastedev.netSupport TASTEDEV
ProductsProduct lineupBuyDocsDownloadsMarketplaceSupport
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcase
PoliciesAbout usPrivacy policyTerms of serviceSubscription termsRefund policyCommunity guidelines
AccountLog inSign up
Visitors
Today
Yesterday
Total views
Company
GXSOFT
Representative
CHOI YOUNG GU
Business registration number
853-44-00368
Address
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Phone
+82-10-4404-1523
Email
whitecalvin@tastedev.net
Privacy officer
CHOI YOUNG GU

© 2026 TASTEDEVProduct information is based on verified development sources.Released · improving

Django docs
Django
Getting Started with DjangoProject StructureCore ConceptsData and StateTestingDeployment
Discussions

Django guide · 6/6

Deployment

A project that runs happily under runserver still needs a few changes before it can go live: production settings, collected static files, a production application server and a reverse proxy in front of it. This chapter goes through those steps in order and shows a common setup.

Production settings

Check these settings before every deployment.

SettingProduction value
DEBUGFalse. When it is on, error pages expose your code and settings
SECRET_KEYA long random value injected from outside the code, e.g. an environment variable
ALLOWED_HOSTSThe domains you serve. It cannot be empty when DEBUG = False
DATABASESConnection details for the production database, often PostgreSQL
STATIC_ROOTThe folder where collectstatic gathers static files
# mysite/settings.py (production-relevant parts)
import os

DEBUG = False
SECRET_KEY = os.environ["DJANGO_SECRET_KEY"]
ALLOWED_HOSTS = ["example.com", "www.example.com"]
CSRF_TRUSTED_ORIGINS = ["https://example.com", "https://www.example.com"]

STATIC_ROOT = BASE_DIR / "staticfiles"

# HTTPS
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
SECURE_SSL_REDIRECT = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_HSTS_SECONDS = 3600

Only enable SECURE_PROXY_SSL_HEADER when your proxy always sets X-Forwarded-Proto and overwrites any value sent by the client. Start HSTS with a short duration and raise it once everything works. When you are done, let Django look for anything you missed:

DJANGO_SECRET_KEY=... python manage.py check --deploy

Static and media files

With DEBUG = False, Django stops serving static files itself. Run collectstatic to copy every app's static/ files into STATIC_ROOT, then let a web server such as Nginx, or a CDN, serve that folder.

python manage.py collectstatic --noinput
python manage.py migrate --noinput

If running a separate web server is inconvenient, add the WhiteNoise package as middleware so the Python process can serve static files efficiently. Keep user uploads (MEDIA_ROOT) separate from static files, and when you run several servers, point the STORAGES setting at an object store such as S3.

WSGI and ASGI servers

The wsgi.py and asgi.py files created by startproject each expose an application object. For mostly synchronous views, use a WSGI server such as Gunicorn. If you need async views or WebSockets (Django Channels), use an ASGI server such as Uvicorn or Daphne.

python -m pip install gunicorn uvicorn

# WSGI with four worker processes
gunicorn mysite.wsgi --workers 4 --bind 127.0.0.1:8000

# ASGI with Uvicorn on its own
uvicorn mysite.asgi:application --host 127.0.0.1 --port 8000 --workers 4

Start with a worker count based on your CPU cores and tune it under real load. Run the server under a process manager such as systemd, Supervisor or a container orchestrator, so it restarts after a crash.

Reverse proxy

Put a reverse proxy such as Nginx in front of the application server. The proxy terminates TLS, serves static files and buffers slow clients, and forwards only dynamic requests to Gunicorn.

server {
    listen 443 ssl;
    server_name example.com;

    location /static/ {
        alias /srv/mysite/staticfiles/;
    }

    location / {
        proxy_pass http://127.0.0.1:8000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Deploying with containers

Containers give every server an identical environment. Keep secrets out of the image and pass them in as environment variables at run time.

FROM python:3-slim

ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .
RUN DJANGO_SECRET_KEY=build-only python manage.py collectstatic --noinput

CMD ["gunicorn", "mysite.wsgi", "--bind", "0.0.0.0:8000", "--workers", "4"]

Run migrations once as a deployment step, not while building the image. In production, collect errors through the LOGGING setting and get notified about exceptions via ADMINS or a service such as Sentry.

Summary

  • Set DEBUG = False, a secret SECRET_KEY and ALLOWED_HOSTS, then verify with check --deploy.
  • Gather static files with collectstatic and serve them from a web server or WhiteNoise.
  • Run the app with Gunicorn (WSGI) or Uvicorn (ASGI) behind a reverse proxy such as Nginx.
  • Run migrations as part of the deployment and set up logging and error reporting.

Official documentation

  • Deployment checklist: production settings to review
  • How to deploy Django: WSGI and ASGI deployment guides
  • How to manage static files: working with static files
  • Settings reference: every available setting
  • Django documentation: the documentation home page
Questions about this chapter?
Previous chapterTesting

0 comments

Top commentsNewest first

Sign in · Sign in to leave a comment.