Skip to content

Commit

Permalink
Integrated DB
Browse files Browse the repository at this point in the history
  • Loading branch information
aashutoshrathi committed Oct 3, 2018
1 parent f5aa08d commit 5db285b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
7 changes: 7 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
WEB_CONCURRENCY=2
DEBUG=True
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ venv
staticfiles
.env
*.sqlite3
.vscode
8 changes: 1 addition & 7 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[requires]

python_version = "3.6"


[packages]

"psycopg2-binary" = "*"
django-heroku = "*"
gunicorn = "*"


[dev-packages]

pylint = "*"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Lab Management system

To use this project, follow these steps:

- Make a `.env` file having same structure as `.env.sample`

## Deployment to Heroku

$ git init
Expand Down
11 changes: 8 additions & 3 deletions brutus/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import os
import dj_database_url
import django_heroku
from decouple import config

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand All @@ -25,7 +26,7 @@
SECRET_KEY = "8!o$bd5o)#1(r71jhva=b46g^dthc06n+h2d6=ea+g_@2l8e-t"

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = config('DEBUG', cast=bool)

# Application definition

Expand Down Expand Up @@ -80,8 +81,12 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': config('DB_NAME'),
'USER': config('DB_USER'),
'PASSWORD': config('DB_PASSWORD'),
'HOST': config('DB_HOST'),
'PORT': config('DB_PORT'),
}
}

Expand Down

0 comments on commit 5db285b

Please sign in to comment.