ricardomol
  • Ricardomol Notes
  • Frontend
    • Javascript Toolchain
    • Javascript
      • Quirks
      • Articles
        • Function caching
        • 12 JS Tricks
      • Closures
      • Assorted
      • ES6
      • this
      • OOP
      • Async Programming
      • Functional Programming
      • Typescript
    • React
      • Patterns
        • Render props
      • React Router
    • Webpack
    • CSS
      • Resources
  • Backend
    • Python
      • Shallow copy vs deep copy
      • Classes
      • Resources
      • Python C Extensions
      • Coroutines
      • Exceptions
      • Context managers
      • One-Liners
      • Open function
      • Object introspection
      • Targeting Python 2 + 3
      • For - else
      • Comprehensions
      • Lambdas
      • __slots__ magic
      • Collections
      • Enumerate
      • Mutation
      • Map, Filter and Reduce
      • Decorators
      • Sets
      • Fluent Python summary
      • Quizes / Tips
      • Generators
    • Django
      • Generic Relations
      • FBV's vs CBV's
      • ORM
      • DRF
    • RESTful Architecture
    • Resources
  • Databases
    • Joins
    • Normalization
    • PostgreSQL
  • DevOps
    • Docker
      • 0. Resources
      • 2. Services
      • 3. Swarms
      • 5. Stacks
      • 6. Deploy your app
    • CI
      • CI with Django
    • CD
    • PaaS
    • WSGI servers
    • Django
      • Django Deployment
    • Modern DevOps with Django
  • Git
    • Git
  • Comp Sci
    • Big O Notation
    • Patterns
    • Programming paradigms
  • Assorted
    • TCP vs UDP
    • Tests
    • MongoDB
    • Node
      • Resources
    • Go
    • HTTP vs HTTP2
    • GraphQL
    • Books
    • Vim
    • IPv4 vs IPv6
    • Regex
    • Redis
    • Celery
      • Brokers
    • Caching
  • SECURITY
    • Security
Powered by GitBook
On this page
  • Deployment
  • Deployment hosting options
  • Deployment tools
  • Deployment learning checklist
  1. DevOps
  2. Django

Django Deployment

Source: https://www.fullstackpython.com/deployment.html

PreviousDjangoNextModern DevOps with Django

Last updated 6 years ago

Deployment

Packaging up your web application and putting it in a production environment that can run the app.

Deployment hosting options

There are four options for deploying and hosting a web application:

The first three options are similar. The deployer needs to provision one or more servers with a Linux distribution. System packages, a web server, WSGI server, database and the Python environment are then installed. Finally the application can be pulled from source and installed in the environment.

Note that there are other ways of installing a Python web application through system-specific package management systems. We won't cover those in this guide as they are considered advanced deployment techniques.

Deployment tools

  • is the deploy system used by the development teams at Pinterest, a huge Python shop!

  • is a build system originally created at Twitter and now split out as its own sustainable open source project.

  • is an open source build system originally developed at Yahoo! that is now open source. Learn more about it in the that contains the rationale for its creation.

Deployment resources

Deployment learning checklist

If you need a step-by-step guide to deploying a Python web application, I wrote on exactly this topic called that you'll find super helpful.

is an episode of the great Talk Python to Me podcast series where I discuss deploying web applications based on a fairly traditional virtual private server, Nginx and Green Unicorn stack.

walks through stages of deployment with source control, planning, continuous deployment and monitoring the results.

is a long must-read for understanding how to deploy software properly.

teaches the history, including the mistakes, that Reddit's development teams learned as they scaled up the development team and the traffic on one of the most-visited websites in the world.

explains various ways that development teams deploy applications, ranging from reckless to versioned.

provides a high-level overview of tactics for how teams at large scale can deploy changes several times per day or more with confidence the systems will not completely fail. There will be bugs, but that does not mean the entire operation will stop.

explains how SoundCloud automates their deployment process and uses canary builds to identify and roll back issues to mitigate reliability issues that can occur with shipping software at scale.

defines delivery versus deployment and walks through a continuous deployment workflow.

provides an awesome overview of one developer's story for how he gradually learned about deployment automation. The story follows my own journey in many ways, from starting with brittle scripts, moving to Fabric and then on to for higher-level and continuous deployment pipelines.

is a talk from where Andrew Baker deploys the getting started app using Ngrok, Heroku, Zappa on the platform, a virtual machine on Google Cloud and .

is the story of how their deployment process evolved over time from a large Fabric script to continuous deployments. Along the way they encountered issues with code reviews, test failures, canary builds and rollbacks. It's a great read that sheds some light on how Python deployments can be done well at large scale.

Stack Overflow's guide on is an awesome in-depth read covering topics ranging from git branching to database migrations.

In , he talks about engineering practices for continuous delivery. He explains the difference between , continuous deployment and continuous delivery. Highly recommended for an overview of deployment concepts and as an introduction to the other videos on those subjects in that series.

shows how to deploy a architecture that uses , , and React with container orchestration on Amazon ECS.

If you're tight on time look at the options. You can deploy a low traffic project web app for free or low cost. You won't have to worry about setting up the operating system and web server compared to going the traditional server route. In theory you should be able to get your application live on the web sooner with PaaS hosting.

are your best bet for learning how the entire Python web stack works. You'll often save money with a virtual private server instead of a platform-as-a-service as you scale up.

Read about servers, , and to get a broad picture of what components need to be set up to run a Python web application.

"Bare metal" servers
Virtualized servers
Infrastructure-as-a-service
Platform-as-a-service
teletraan
pants
Screwdriver
introduction post
a whole book
The Full Stack Python Guide to Deployments
Deploying Python web applications
Thoughts on web application deployment
Deploying Software
The evolution of code deploys at Reddit
Deployment strategies defined
How we release so frequently
Hands-off deployment with Canary
Practical continuous deployment
Automation for the People
Bash
Ansible
configuration management
5 ways to deploy your Python application in 2017
PyCon US 2017
Flask
serverless
AWS Lambda
Docker
Continuous deployment at Instagram
how they do deployment
this free video by Neal Ford
continuous integration
TestDriven.io
microservices
Docker
Flask
platform-as-a-service (PaaS)
Traditional server options
operating systems
web servers
WSGI servers