[Django]-Unknown command: 'collectstatic' Django 1.7

1👍

It looks like it can’t find the environment variable OPENSHIFT_APP_NAME. You should try setting it and see if that fixes the problem. Django can’t import your settings because it can’t find that environment variable.

Those environment variables look like they are set by openshift. You are probably running that collectstatic command in a shell that has not had them set. You’ll either need to set them in the shell or edit your settings.py to be able to handle this situation. Something like this would work:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': os.environ.get('OPENSHIFT_APP_NAME', 'A sensible default'),

Leave a comment