ShihabYasin / django-media-management-

Static and Media Files in Django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static and Media Files in Django

Setup Instructions

  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 uses WhiteNoise to serve up the static files, so you'll need to add Nginx in order to handle media files appropriately.

About

Static and Media Files in Django

License:MIT License


Languages

Language:Python 83.0%Language:HTML 11.9%Language:Shell 4.0%Language:CSS 1.1%