Unable to perform collectstatic

user3383301 picture user3383301 · Apr 22, 2014 · Viewed 67.7k times · Source

I am new to django ! When I use the command python manage.py collectstatic I get this error

django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path

But I can successfully run the server .

My static files declarations are :

STATIC_ROOT = ''

STATIC_URL = '/static/'


STATICFILES_DIRS = (

    ('assets', os.path.join(PROJECT_DIR, '../static')),
)

and debug is set to true

DEBUG = True

How can I fix this? Else am missing any installation packages ?

Answer

dhana picture dhana · Apr 22, 2014

Try this,

PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')

Look at https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATIC_ROOT