Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F70470180
settings_dev.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
Sun, Jul 7, 00:46
Size
1 KB
Mime Type
text/x-python
Expires
Tue, Jul 9, 00:46 (2 d)
Engine
blob
Format
Raw Data
Handle
18829590
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
settings_dev.py
View Options
# settings for dev.py
import
environ
import
os
# 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
,
True
)
)
# 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'
)
# wildcard to change for production
ALLOWED_HOSTS
=
[
'*'
]
# }
DATABASES
=
{
# read os.environ['DATABASE_URL'] and raises ImproperlyConfigured exception if not found
'default'
:
{
'ENGINE'
:
'django.db.backends.mysql'
,
'NAME'
:
env
(
'DBNAME'
),
'USER'
:
env
(
'DBUSER'
),
'PASSWORD'
:
env
(
'DBPASSWORD'
),
'HOST'
:
env
(
'DBHOST'
),
'PORT'
:
'5432'
,
}
}
# Env.db_url_config('sqlite:////full/path/to/your/file.sqlite')
# {'ENGINE': 'django.db.backends.sqlite3', 'HOST': '', 'NAME': '/full/path/to/
# ˓→your/file.sqlite', 'PASSWORD': '', 'PORT': '', 'USER': ''}
Event Timeline
Log In to Comment