Search code examples
pythondjangostaticcollectstatic

collectstatic collects additional files to STATICFILES_DIRS in django


My settings looks like this:

STATIC_URL  = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static/")

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, "polls/static/"),
)

So now when I run collectstatic it also collects stuff from

'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin/css

I understand that collectstatic goes through the INSTALLED_APPS according to here

whic is fine but /usr/local is not in the INSTALLED_APPS

What am I doing wrong here?


Solution

  • You should have django.contrib.admin in your INSTALLED_APPS, that why when you run collectstatic, it collect its static files.