diff --git a/.gitignore b/.gitignore index c6cb2f4..43addad 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__ /venv db.sqlite3 +/securityquiz/secrets.py diff --git a/requirements.txt b/requirements.txt index 5fbb080..63f5815 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ django django-oauth-toolkit django-cors-headers -pyopenssl \ No newline at end of file +pyopenssl +psycopg2 \ No newline at end of file diff --git a/securityquiz/secrets.py.template b/securityquiz/secrets.py.template new file mode 100644 index 0000000..6df66a9 --- /dev/null +++ b/securityquiz/secrets.py.template @@ -0,0 +1,4 @@ +DB_HOST = '' +DB_NAME = '' +DB_USER = '' +DB_PASSWORD = '' \ No newline at end of file diff --git a/securityquiz/settings.py b/securityquiz/settings.py index 2641857..2ae3968 100755 --- a/securityquiz/settings.py +++ b/securityquiz/settings.py @@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import sys +from . import secrets + BASE_DIR = os.path.dirname(os.path.dirname(__file__)) CLOSED = False @@ -65,8 +67,11 @@ WSGI_APPLICATION = 'securityquiz.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': secrets.DB_NAME, + 'USER': secrets.DB_USER, + 'PASSWORD': secrets.DB_PASSWORD, + 'HOST': secrets.DB_HOST } }