Skip to content

Commit 22169e2

Browse files
committed
Change from sqlite to postgres in settings.py
1 parent a738e20 commit 22169e2

File tree

1 file changed

+34
-5
lines changed

1 file changed

+34
-5
lines changed

issue_tracker/settings.py

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"""
1212

1313
import os
14+
import dj_database_url
15+
import env
16+
from django.contrib.messages import constants as messages
1417

1518
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1619
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -36,12 +39,16 @@
3639
'django.contrib.contenttypes',
3740
'django.contrib.sessions',
3841
'django.contrib.messages',
42+
'livereload',
3943
'django.contrib.staticfiles',
4044
'django_forms_bootstrap',
4145
'accounts',
4246
'tickets',
4347
'taggit',
4448
'simple_history',
49+
'rest_framework',
50+
'crispy_forms',
51+
'checkout',
4552
]
4653

4754
MIDDLEWARE = [
@@ -53,6 +60,7 @@
5360
'django.contrib.messages.middleware.MessageMiddleware',
5461
'django.middleware.clickjacking.XFrameOptionsMiddleware',
5562
'simple_history.middleware.HistoryRequestMiddleware',
63+
'livereload.middleware.LiveReloadScript',
5664
]
5765

5866
ROOT_URLCONF = 'issue_tracker.urls'
@@ -79,14 +87,19 @@
7987
# Database
8088
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
8189

90+
# sqlite3
91+
# DATABASES = {
92+
# 'default': {
93+
# 'ENGINE': 'django.db.backends.sqlite3',
94+
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
95+
# }
96+
# }
97+
98+
# postgresql
8299
DATABASES = {
83-
'default': {
84-
'ENGINE': 'django.db.backends.sqlite3',
85-
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
86-
}
100+
'default': dj_database_url.parse("postgres://hduoshlpgoxoyi:fa43c8f4059c34a7cbe4d45c3443200db5fbe8b956f313816e75a9c9d7668d50@ec2-54-195-247-108.eu-west-1.compute.amazonaws.com:5432/d7orbajbrr4b8i")
87101
}
88102

89-
90103
# Password validation
91104
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
92105

@@ -131,3 +144,19 @@
131144
MESSAGE_STORAGE = "django.contrib.messages.storage.session.SessionStorage"
132145

133146
TAGGIT_CASE_INSENSITIVE = True
147+
148+
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
149+
MEDIA_URL = '/media/'
150+
151+
CRISPY_TEMPLATE_PACK = 'bootstrap4'
152+
153+
STRIPE_PUBLISHABLE = os.getenv('STRIPE_PUBLISHABLE')
154+
STRIPE_SECRET = os.getenv('STRIPE_SECRET')
155+
156+
MESSAGE_TAGS = {
157+
messages.DEBUG: 'alert-info',
158+
messages.INFO: 'alert-info',
159+
messages.SUCCESS: 'alert-success',
160+
messages.WARNING: 'alert-warning',
161+
messages.ERROR: 'alert-danger',
162+
}

0 commit comments

Comments
 (0)