CSS and media files missing with DJANGO

October 20, 2014 8.3k views

I’ve just created a Unbuntu 14.04 x64 droplet with Django - but the media/static files seem to be missing from the install.

There are no folders in /home/django/django_project/django_project - both the ‘static’ and 'media’ folders (and contents) are missing.
Therefor admin interface are missing the CSS and image files.

Where can I locate the missing files ?

1 Answer

Make sure that django.contrib.admin is included in INSTALLED_APPS in your settings.py file. Then run python manage.py collectstatic This will collect all of the static files for included apps into one directory defined by STATIC_ROOT so that you can serve them with a webserver like Nginx.

See the Django documentation for more details.

Have another answer? Share your knowledge.