user3383301 user3383301 - 3 years ago 248
Python Question

Unable to perform collectstatic

I am new to django ! When i use the command

python 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_URL = '/static/'


('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 Source

Try this,

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

Look at

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download