Example repo for the Working with Static and Media Files in Django article.
-
Clone down the repo
-
Create and activate a virtual environment
-
Install the dependencies:
$ pip install -r requirements.txt
-
Apply the migrations:
$ python manage.py migrate
$ python manage.py runserver
-
Set
DEBUG
toFalse
in the settings.py file -
Then, collect the static files and run Gunicorn:
$ python manage.py collectstatic $ gunicorn core.wsgi:application -w 1
This DOES NOT use WhiteNoise to serve up the static files.