if not os.path.exists(DATA_DIR): os.makedirs(DATA_DIR) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! secret_key_file = os.getenv('SECRET_KEY_FILE', None) if secret_key_file is None: secret_key_file = os.path.join(DATA_DIR, 'secret.dat') if not os.path.exists(secret_key_file): from squad.core.utils import random_key fd = os.open(secret_key_file, os.O_WRONLY | os.O_CREAT, 0o600) with os.fdopen(fd, 'w') as f: f.write(random_key(64)) SECRET_KEY = open(secret_key_file).read() DEBUG = os.getenv('ENV') not in ['production', 'staging'] ALLOWED_HOSTS = ['*'] # Application definition try: import imp imp.find_module('django_extensions') django_extensions = 'django_extensions' except ImportError:
if not os.path.exists(DATA_DIR): os.makedirs(DATA_DIR) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! secret_key_file = os.getenv('SECRET_KEY_FILE', None) if secret_key_file is None: secret_key_file = os.path.join(DATA_DIR, 'secret.dat') if not os.path.exists(secret_key_file): from squad.core.utils import random_key fd = os.open(secret_key_file, os.O_WRONLY | os.O_CREAT, 0o600) with os.fdopen(fd, 'w') as f: f.write(random_key(64)) SECRET_KEY = open(secret_key_file).read() DEBUG = os.getenv('ENV') != 'production' ALLOWED_HOSTS = ['*'] # Application definition try: import imp imp.find_module('django_extensions') django_extensions = 'django_extensions' except ImportError: