Django Explained: Beginners Guide to Python Web Development

Repo

Who Am I

  • Fullstack Engineer @Arbormoon
  • @dougwlance
  • Writing Python for ~14 years
  • Building Django apps for ~5 years

What is Django

Django is a web framework for building web-based applications using Python.

  • Created at a newspaper company
  • Named after Django Reinhardt
  • First released July 21, 2005
  • Version 3.0 released December 2019

Why use Django

  • Easy to use
  • Batteries-included
  • Well documented
  • Django Admin
  • Open-source
  • Secure
  • Strong ecosystem
  • Great ORM system

Who uses Django

  • Instagram
  • Mozilla
  • Pinterest
  • Disqus
  • National Geographic
  • Many others: 47k stars on GitHub

Getting Started

  1. Install Python 3 (help)
  2. Setup a virtual environment
    1. pip install virtualenv
    2. virtualenv venv
    3. source venv/bin/activate
  3. Install Django with pip:
    • pip install Django==3.0.2
  4. Start a new Django project:
    • django-admin startproject $PROJECT_NAME
  5. Start a new Django app:
    • python manage.py startapp $APP_NAME

Project Overview

  • manage.py
  • settings.py
  • MVC

Example App Demo

  • Models
  • Views
  • Templates
  • URLs
  • Tests

Todo App Demo

  • Models
  • Views
  • Templates
  • URLs
  • Tests

Next Steps