-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move corresponding code elements to a specific `src` directory - Create `conn.py` to abstract DB connection functionality
- Loading branch information
1 parent
3f42cf9
commit 7efd785
Showing
13 changed files
with
22 additions
and
38 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
flask | ||
flask-cors | ||
psycopg2-binary | ||
docker | ||
gunicorn | ||
psycopg2 | ||
requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
gunicorn -b 127.0.0.1:8001 app:app | ||
gunicorn -b 127.0.0.1:8001 --chdir src app:app |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
import psycopg2 | ||
from typing import Tuple | ||
|
||
DB_HOST = os.environ.get('DB_HOST', '127.0.0.1') | ||
DB_PORT = os.environ.get('DB_PORT', 5432) | ||
|
||
|
||
def get_connection(): | ||
conn = psycopg2.connect(dbname='evs', | ||
user='postgres', | ||
password='docker', | ||
host=DB_HOST, | ||
port=DB_PORT) | ||
return conn |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters