Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 768 Bytes

README.md

File metadata and controls

37 lines (25 loc) · 768 Bytes

Static and Media Files in Django

Example repo for the Working with Static and Media Files in Django article.

Getting Started

  1. Clone down the repo

  2. Create and activate a virtual environment

  3. Install the dependencies:

    $ pip install -r requirements.txt
  4. Apply the migrations:

    $ python manage.py migrate

Development Example

$ python manage.py runserver

Production Example

  1. Set DEBUG to False in the settings.py file

  2. 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.