Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deploying your django application

Deploying your django application

My Speaker session at Forloop Ibadan

Obi Uchenna David

June 03, 2017

More Decks by Obi Uchenna David

Other Decks in Technology


  1. Deploying your django application OBI Uchenna David @othreecodes Software Engineer

    at Tuteria
  2. Introduction

  3. What We'll Cover •Introduction to Django • What, Why, Who?

    •Setting up development environment •Demo project – "The #Covfefe blog" •Deployment
  4. What? • Open source Web framework (MTV) • Written in

    python • Encourages rapid development and clean, pragmatic design
  5. Why? • Ridiculously fast (C2L) • Versatile • Easy to

    work with • Scalable (shared-nothing architecture) • Secure
  6. Who? https://www.djangosites.org/

  7. Setting up development environment • Being a Python Web framework,

    Django requires Python. Python includes a lightweight database called SQLite so you won’t need to set up a database just yet. • Get the latest version of Python at https://www.python.org/downloads/ or with your operating system’s package manager. • Virtualenv - virtualenv is a tool to create isolated Python environments • Install django via pip
  8. Demo project - thecovfefeblog https://github.com/othreecodes/thecovfefeblog

  9. Project Structure

  10. Deployment • Choosing a Server • Deployment options • Paas:

    Heroku, pythonanywhere • VPS: Digitalocean, Linode, Mediatemple • Automating Deployment with Fabric
  11. Choosing a server • Application size • Price • Features

    of your app • Uwsgi vs Gunicorn
  12. Paas: Heroku • Define a Procfile • requirements.txt • runtime.txt

    • Django Whitenoise • SSL via Let's encrypt
  13. None
  14. None
  15. VPS: DigitalOcean • Cloud Infrastructure provider • Root access •

    Unlimited number of Droplets • One click installations • Low Prices
  16. None
  17. Click to add text DigitalOcean

  18. Nginx • is an open source, lightweight, high-performance web server

    or proxy server. • The Gunicorn "Green Unicorn" is a Python Web Server Gateway Interface (WSGI) • Uwsgi is a server written in C, it is not meant to run stand-alone but has to be placed behind a webserver
  19. Fabric • Fabric is a Python (2.5-2.7) library and command-line

    tool for streamlining the use of SSH for application deployment or systems administration tasks.
  20. Point to note Click to add text • Do not

    re-invent the wheel • Compare your options and see which works best • Finish at least one complete tutorial on django • Understand before you copy and paste
  21. Resources Click to add text • Djangoproject.com • Fullstackpython.com •

    Thenewboston django youtube tutorials • https://www.facebook.com/notes/4117412688 77125/Getting_Started_Django/740106062707 309/ • Djangobook.com • Djangopy.org
  22. Click to add text

  23. Click to add text