Skip to content

Instantly share code, notes, and snippets.

@ross-humphrey
Created February 21, 2020 21:51
Show Gist options
  • Save ross-humphrey/29da4304e2c7954702492db074049955 to your computer and use it in GitHub Desktop.
Save ross-humphrey/29da4304e2c7954702492db074049955 to your computer and use it in GitHub Desktop.
🐍Django on Docker 🐳

Django on Docker - From Scratch

Adapted from Youtube video

Project set up

Create a virtual environment

  • pipenv install django==3.0.3 gunicorn --python 3.8.1
  • Small note to self - look into gunicorn advantages over python manage.py runserver
  • pipenv shell
  • clear Just so you have a nice fresh shell
  • pip freeze - use this to show your installed modules

Create Django Project

  • django-admin startproject cfehome - where cfehome is the project name
  • python manage.py makemigrations
  • python manage.py migrate
  • python manage.py createsuperuser
  • Add the following DEBUG = int(os.environ.get('DEBUG', default=1)) to cfehome/settings.py - commenting the previous DEBUG variable.

Pretty tired for the night - pick up at 5:53 on https://www.youtube.com/watch?v=KaSJMDo-aPs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment