0

I'm working on my project that is basically some type of blog. But I needed to compile different features in one project, which now it can be a problem or maybe not.

In order to work I needed to have STATIC_ROOT and STATICFILES_DIRS but I cannot have them both on same location because I got error (ERRORS: ?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT setting.)

So I searched for answer and I one guy here on stackoverflow said that he just changed location... he suggested to do it like this...

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'assets_static')
MEDIA_ROOT = ''
MEDIA_URL = '/media/'

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]

For that time it has worked, but now I'm changing some static files and they are not updating. Also, now I have folders static and asset_static. Can someone tell what is the best practice here?

Firefoxer
  • 265
  • 3
  • 15
  • Does this answer your question? [How to force Chrome browser to reload .css file while debugging in Visual Studio?](https://stackoverflow.com/questions/15562384/how-to-force-chrome-browser-to-reload-css-file-while-debugging-in-visual-studio) – Ivan Starostin Jan 03 '23 at 22:16
  • sorry, no @IvanStarostin – Firefoxer Jan 03 '23 at 22:29
  • Did you remember to use `manage.py collectstatic` when you had made your changes? Once you have set DEBUG=False Django will only use files in static_root and the collectstatic command puts them there (after finding them in static_url and staticfiles_dirs). See https://stackoverflow.com/questions/24022558/differences-between-staticfiles-dir-static-root-and-media-root – SamSparx Jan 04 '23 at 02:42

0 Answers0