def test_secret(self, env: yaenv.Env): """it can get and generate secret keys""" assert env.secret() == 'notsosecret' assert 'NEW_SECRET_KEY' not in env _secret = env.secret('NEW_SECRET_KEY') assert _secret is not None assert _secret != env.secret('NEW_SECRET_KEY2') del env['NEW_SECRET_KEY'], env['NEW_SECRET_KEY2']
#: A list of host/domain names that this site can serve. #: See :setting:`ALLOWED_HOSTS`. ALLOWED_HOSTS = env.list('ALLOWED_HOSTS', [ '127.0.0.1', '0.0.0.0', 'localhost', '[::1]', # From https://stackoverflow.com/questions/9626535/#36609868 env['DOMAIN'].split('//')[-1].split('/')[0].split('?')[0] ]) #: | A boolean that turns debug mode on/off. See :setting:`DEBUG`. #: | **SECURITY WARNING: never turn this on in production!** DEBUG = env.bool('MANGADV_DEBUG', False) #: | A secret key used to provide cryptographic signing. #: See :setting:`SECRET_KEY`. #: | **SECURITY WARNING: this must be kept secret!** SECRET_KEY = env.secret('SECRET_KEY') #: The ID of the current site. See :setting:`SITE_ID`. SITE_ID = 1 ##################### # Application # ##################### #: A list of strings designating all applications #: that are enabled in this Django installation. #: See :setting:`INSTALLED_APPS`. INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes',