1

I'm learning to use Django and am trying to deploy a project on Heroku. When I try to deploy the project through the command window I get the following traceback when it runs python manage.py collectstatic

Improperly Configured: You're using the staticfiles app without having set
the STATIC_ROOT setting to a filesystem path.

My settings for heroku are:

if os.getcwd() == '/app':
    import dj_database_url
    DATABASES = {
        'default': dj_database_url.config(default='postgres://localhost')
    }

    SECURE_PROXY_SSL_HEADER  = ('HTTP_X_FORWARDED_PROTO', 'https')

    ALLOWED_HOSTS = [*]

    # Static set configuration 
    BASE_DIR = os.path.dirname(os.path.abspath(__file__))
    STATIC_ROOT = 'staticfiles'
    STATICFILES_DIR = (
        os.path.join(BASE_DIR, 'static'),
    )

I'm new to django and I'd appreciate any help, thanks.

brennan
  • 3,392
  • 24
  • 42
  • 1
    Why do you have that strange guard in your settings file? You don't need anything like that. – Daniel Roseman Feb 10 '17 at 09:31
  • Extending @DanielRoseman comment, check out Heroku's starter template for Django as the recommended way to configure the project [here](https://github.com/heroku/heroku-django-template/blob/master/project_name/settings.py) – Alan Avalos Feb 10 '17 at 12:36
  • @AlanAvalos Thanks I'll check that out. – WelcomeSoap Feb 13 '17 at 05:23

0 Answers0