-
Notifications
You must be signed in to change notification settings - Fork 97
/
Copy pathdevelopment.py
41 lines (33 loc) · 1.14 KB
/
development.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
from .get_token import get_token
from .settings import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
SECRET_KEY = os.getenv('LOCAL_SECRET_KEY')
# Don't use Whitenoise to avoid having to run collectstatic first.
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
ALLOWED_HOSTS = ['*']
# Configure connection setting for local PostgreSQL instance.
# Set these environment variables in the .env file for this project.
if 'USE_REMOTE_POSTGRESQL' in os.environ:
# Configure database connection for remote PostgreSQL instance.
DBHOST=os.environ['DBHOST'] + ".postgres.database.azure.com"
DBNAME=os.environ['DBNAME']
DBUSER=os.environ['DBUSER']
DBPASS='set with get_token()'
else:
# Configure database connection for local PosgreSQL instance.
DBHOST=os.environ['DBHOST']
DBNAME=os.environ['DBNAME']
DBUSER=os.environ['DBUSER']
DBPASS=os.environ['DBPASS']
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': DBNAME,
'HOST': DBHOST,
'USER': DBUSER,
'PASSWORD': DBPASS,
}
}
get_token()