From 663a94a305cab395be08b4f66c5c7f19812b85fa Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Tue, 1 May 2018 13:58:24 +0200 Subject: [PATCH] Add postgres --- app.py | 3 +-- models.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 86b483a..e465fa9 100644 --- a/app.py +++ b/app.py @@ -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) diff --git a/models.py b/models.py index 51d3b0a..4f590a8 100644 --- a/models.py +++ b/models.py @@ -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)