Skip to content

Commit a2bbbd9

Browse files
committed
Updated settings
1 parent b4afb87 commit a2bbbd9

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Diff for: tutorial/settings/base.py

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import os
22

33
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
4-
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
4+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
55

66

77
# Quick-start development settings - unsuitable for production
88
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
99

1010
# SECURITY WARNING: keep the secret key used in production secret!
11-
SECRET_KEY = '4blyti@u4yj$skr7e&g63f*l%#jl(xq&od-2y&qzo^rrs!_p#7'
11+
SECRET_KEY = os.environ['SECRET_KEY']
1212

1313
# SECURITY WARNING: don't run with debug turned on in production!
1414
DEBUG = True
@@ -60,18 +60,6 @@
6060

6161
WSGI_APPLICATION = 'tutorial.wsgi.application'
6262

63-
64-
# Database
65-
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
66-
67-
DATABASES = {
68-
'default': {
69-
'ENGINE': 'django.db.backends.sqlite3',
70-
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
71-
}
72-
}
73-
74-
7563
# Password validation
7664
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
7765

Diff for: tutorial/settings/dev.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
# Override base.py settings here
44

5-
5+
DATABASES = {
6+
'default': {
7+
'ENGINE': 'django.db.backends.sqlite3',
8+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
9+
}
10+
}
611

712
try:
813
from tutorial.settings.local import *

Diff for: tutorial/settings/prod.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
from tutorial.settings.base import *
22

33
# Override base.py settings here
4-
4+
DEBUG = False
5+
ALLOWED_HOSTS = ['*']
6+
DATABASES = {
7+
'default': {
8+
'ENGINE': 'django.db.backends.sqlite3',
9+
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
10+
}
11+
}
512

613

714
try:

0 commit comments

Comments
 (0)