From 039855db6fac6e7ce7693e64408ae44aeaa4c788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Barna?= Date: Fri, 28 Oct 2016 04:17:03 +0200 Subject: [PATCH] Connect PG to the app --- app.py | 7 +++++++ requirements.txt | 2 ++ 2 files changed, 9 insertions(+) diff --git a/app.py b/app.py index 9817466..4393442 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,13 @@ #!/usr/bin/env python3 +import os import connexion +import sqlalchemy + +from sqlalchemy import create_engine, Column, Integer, String +from sqlalchemy.ext.declarative import declarative_base + +engine = create_engine( os.environ.get( 'DATABASE_URL', 'sqlite:///:memory:' ), echo=True ) app = connexion.App(__name__, specification_dir='./swagger/') app.add_api('swagger.yaml', diff --git a/requirements.txt b/requirements.txt index 92eee81..fca91f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,5 @@ Flask==0.11.1 Flask-RESTful==0.3.5 connexion==1.0.129 gunicorn +sqlalchemy +psycopg2