[Fixed]-Static files aren't loading after changing STATIC_ROOT and STATICFILES_DIRS in django

1👍

Where are you keeping your static files?

If you are keeping them in BASE_DIR/static then it is important to include the sameSTATICFILES_DIRS` as you have in the second settings file.

If you having your static files spread throughout your different apps then you want to make sure that django.contrib.staticfiles.finders.AppDirectoriesFinder is added to your STATICFILES_FINDERS.

The point of collectstatic is to get static files from all your various apps (admin,polls,ect.) and move them to your static root for serving. You also need to make sure that your STATIC_ROOT is being served.

It’s also probably not a good idea to have you STATIC_ROOT pointing to somewhere inside your BASE_DIR – usually this will not be served statically by your web server.

Leave a comment