Skip to content
This repository has been archived by the owner on Feb 18, 2019. It is now read-only.

Commit

Permalink
make seta works on heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeLing committed Aug 9, 2016
1 parent e6111cc commit 4833970
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: python src/server.py
10 changes: 8 additions & 2 deletions database/config.py
@@ -1,9 +1,15 @@
import os
import urlparse
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base


engine = create_engine('mysql+mysqldb://root:root@localhost/ouija2', echo=True)
DBURL = urlparse.urlparse(os.environ["DATABASE_URL"])

databaseUrl = 'postgresql+psycopg2://{username}:{password}@{host}:{port}/{database}'
engine = create_engine(databaseUrl.format(username=DBURL.username, password=DBURL.password,
host=DBURL.hostname, port=DBURL.port,
database=DBURL.path[1:]), echo=True)
Session = sessionmaker(engine)

session = Session()
2 changes: 1 addition & 1 deletion requirements.txt
@@ -1,6 +1,6 @@
Flask==0.10.1
MarkupSafe==0.23
MySQL-python==1.2.5
psycopg2==2.6.2
Flask-SQLAlchemy==2.1
argparse==1.2.1
requests==2.9.1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -4,7 +4,7 @@
required = [
"Flask",
"MarkupSafe",
"MySQL-python",
"psycopg2",
"argparse",
"requests",
"redo"
Expand Down

0 comments on commit 4833970

Please sign in to comment.