Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103221982
settings_valid.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 28, 07:09
Size
746 B
Mime Type
text/x-python
Expires
Sun, Mar 2, 07:09 (1 d, 18 h)
Engine
blob
Format
Raw Data
Handle
24509932
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
settings_valid.py
View Options
"""
Validation Settings
"""
import
environ
# If using in your own project, update the project namespace below
from
django_app.settings
import
*
env
=
environ
.
Env
(
# set casting, default value
DEBUG
=
(
bool
,
False
)
)
DBHOST
=
env
(
'DBHOST'
)
DBNAME
=
env
(
'DBNAME'
)
DBPASSWORD
env
(
'DBPASSWORD'
)
DBUSER
=
env
(
'DBUSER'
)
# False if not in os.environ
DEBUG
=
env
(
'DEBUG'
)
# Raises django's ImproperlyConfigured exception if SECRET_KEY not in os.environ
SECRET_KEY
=
env
(
'SECRET_KEY'
)
ALLOWED_HOSTS
=
env
.
list
(
'ALLOWED_HOSTS'
)
# Parse database connection url strings like psql://user:pass@127.0.0.1:8458/db
DATABASES
=
{
# read os.environ['DATABASE_URL'] and raises ImproperlyConfigured exception if not found
'default'
:
env
.
db
(),
}
Event Timeline
Log In to Comment