From 63887186697f4034bfeab7bee5000ed6bac249a7 Mon Sep 17 00:00:00 2001 From: Spencer Romo Date: Thu, 11 Aug 2016 21:34:18 -0500 Subject: [PATCH] Testing if database connection works ok. --- .gitignore | 2 +- banded/settings.py | 10 +++++++--- readme.md | 20 ++++++++++++++++++++ requirements.txt | 3 ++- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index a14ff51..c66bcd8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ *.pyc env/ - \ No newline at end of file +env.txt \ No newline at end of file diff --git a/banded/settings.py b/banded/settings.py index a324044..3bc9686 100644 --- a/banded/settings.py +++ b/banded/settings.py @@ -75,10 +75,14 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': os.environ.get('DB_NAME'), + 'USER': os.environ.get('DB_USERNAME'), + 'PASSWORD': os.environ.get('DB_PASSWORD'), + 'HOST': os.environ.get('DB_HOST'), + 'PORT': os.environ.get('DB_PORT'), + } } -} # Password validation diff --git a/readme.md b/readme.md index a508fed..d19db93 100644 --- a/readme.md +++ b/readme.md @@ -3,3 +3,23 @@ A new take on banded. Done better, and stronger and smarter. Just adding some text to test dev deployment. + + +working with this locally?? + + +You'll need a few things. + +Firstly, I used a postgres DB. According to the fine producers of the Djaango project, it provides great features that the other db's just don't. +P.S. I like having JSON on my objects...just saying. + +To get this working on a mac locally you need a DB driver + +$ brew install postgresql + +of course, you'll need the an actual DB behind the resources. I have environment vars. What do you have? + +Then, install the requirements. + +$ pip install -r requiremenst.txt + diff --git a/requirements.txt b/requirements.txt index 9f909d5..256327e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ Django==1.10 -gunicorn==19.3.0 \ No newline at end of file +gunicorn==19.6.0 +psycopg2==2.6.2