KeyError: 'collectstatic' Issue

I'm getting the following error when I try to run collect static:

KeyError: 'collectstatic'

Followed by:

ImproperlyConfigured("The SECRET_KEY setting must not be empty.") django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

I don't seem to have an issue with secret key as can run the website ok, have set up environment variables in WYSGI and bash and also can get my key back by running echo $SECRET_KEY.

Any ideas what I'm missing here?

Is your using the same settings that get SECRET_KEY from the env?

Ah, got it. Needed to modify to point to production settings file. Thanks

Glad to see that you figured it out.