Add postgres

This commit is contained in:
Andros Fenollosa 2018-05-01 13:58:24 +02:00
parent afb35ea3b5
commit 663a94a305
2 changed files with 2 additions and 4 deletions

3
app.py
View File

@ -8,8 +8,7 @@ app.config['SECRET_KEY'] = 'my secret'
app.config['DEBUG'] = False
# Database
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///book.sqlite'
# app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root@localhost/book'
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql+psycopg2://bgcmtrdgusuwik:05060b67183fb8ba7ddb937aaec3f6a20617b3bbd547ce89a19eceb760f6fa4b@ec2-54-217-217-142.eu-west-1.compute.amazonaws.com:5432/d2po2asdglml7g'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app)

View File

@ -2,8 +2,7 @@ from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///book.sqlite'
#app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root@localhost/book'
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql+psycopg2://bgcmtrdgusuwik:05060b67183fb8ba7ddb937aaec3f6a20617b3bbd547ce89a19eceb760f6fa4b@ec2-54-217-217-142.eu-west-1.compute.amazonaws.com:5432/d2po2asdglml7g'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(app)