[Answered ]-Static files not found in Django 1.4

0đź‘Ť

âś…

2đź‘Ť

When you run “collectstatic”, are all files copied to STATIC_ROOT?
You should verify this first so you know the files are where they should be.

Have you configured apache to serve the static files in STATIC_ROOT as “/static/”? Django does not serve static files for you in production (DEBUG=False) so you need to configure your web server software to serve the files for you.

Also, I don’t think you want your STATICFILES_DIRS to contain the same path as STATIC_ROOT. Files are copied from the dirs in STATICFILES_DIRS to STATIC_ROOT. Your STATICFILES_DIRS should contain dirs that are not otherwise searched during “collectstatic”.

0đź‘Ť

Warning

This will only work if DEBUG is True.

That’s because this view is grossly inefficient and probably insecure. This is only intended for local development, and should never be used in production.

If you still need to server static locally (e.g. for testing without debug) you can run dev server in insecure mode:

python manage.py runserver --insecure

Enjoy cheer 🙂

👤Ashish Gupta

Leave a comment