0

In my development environment I've deleted my static files directory (rm -rf [PROJECT_NAME]/static/), emptied my browser's cache, restarted the server and still when I load a page, the static files (my JS, CSS, etc.) are still there (e.g. http://192.168.1.100:8000/static/js/bootstrap.min.js). I can't figure out how. This happens with both runserver and gunicorn. How are they still being served and how can I stop them from being served?

Jeff Bowen
  • 5,904
  • 1
  • 28
  • 41

1 Answers1

1

Check the value of STATIC_ROOT variable in Django settings.py file.

P̲̳x͓L̳
  • 3,615
  • 3
  • 29
  • 37
  • Thanks for the quick suggestion but `STATIC_ROOT` looks properly configured: `STATIC_ROOT = os.path.join(SITE_ROOT, 'static')`. – Jeff Bowen Sep 01 '13 at 02:56
  • What about [STATICFILES_DIRS](https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATICFILES_DIRS). – P̲̳x͓L̳ Sep 01 '13 at 03:28
  • Aha! That's it. I misunderstood how `STATICFILES_DIRS` works. Re-read the docs and now it makes sense. I thought these were just directories that were crawled when running `./manage.py collectstatic` and didn't realize that the `STATICFILES_FINDERS` were used as the server ran. Glad to discover I only need to run `collectstatic` in production (I'm using Heroku along with Amazon S3) and not during development. Thanks a lot for your help @pxl! – Jeff Bowen Sep 01 '13 at 04:10