Connect PG to the app

This commit is contained in:
Gábor Barna 2016-10-28 04:17:03 +02:00
parent 707a5c41cd
commit 039855db6f
2 changed files with 9 additions and 0 deletions

7
app.py
View File

@ -1,6 +1,13 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os
import connexion 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 = connexion.App(__name__, specification_dir='./swagger/')
app.add_api('swagger.yaml', app.add_api('swagger.yaml',

View File

@ -2,3 +2,5 @@ Flask==0.11.1
Flask-RESTful==0.3.5 Flask-RESTful==0.3.5
connexion==1.0.129 connexion==1.0.129
gunicorn gunicorn
sqlalchemy
psycopg2