diff --git a/dev-env.sh b/dev-env.sh new file mode 100644 index 00000000..67643760 --- /dev/null +++ b/dev-env.sh @@ -0,0 +1,5 @@ +# source this for fake developer settings + +export DJANGO_SECRET_KEY=`uuidgen -r` +export STRIPE_PUBLIC_KEY=`uuidgen -r` +export STRIPE_SECRET_KEY=`uuidgen -r` diff --git a/pinaxcon/settings.py b/pinaxcon/settings.py index 2c9cac10..c2b50384 100644 --- a/pinaxcon/settings.py +++ b/pinaxcon/settings.py @@ -61,11 +61,25 @@ saml2_contact = { 'email_address': os.environ.get('META_EMAIL', 'op@example.com'), 'contact_type': 'technical'}, +fail = False -if (SECRET_KEY is None or PINAX_STRIPE_PUBLIC_KEY is None or - PINAX_STRIPE_SECRET_KEY is None): - sys.exit('CONFIG ERROR') +if SECRET_KEY is None: + print("FAILURE: You need to supply a DJANGO_SECRET_KEY " + "environment variable") + fail = True +if PINAX_STRIPE_PUBLIC_KEY is None: + print("FAILURE: You need to supply a STRIPE_PUBLIC_KEY " + "environment variable") + fail = True + +if PINAX_STRIPE_SECRET_KEY is None: + print("FAILURE: You need to supply a STRIPE_SECRET_KEY " + "environment variable") + fail = True + +if fail: + sys.exit('FAILURE: Missing environment variables.') ### Standard settings