mirror of
https://github.com/Xevion/runnerspace.git
synced 2025-12-06 11:16:17 -06:00
Add psycopg2 to Pipfile for SQLAlchemy Postgresql support
I'm not sure why this isn't installed automatically, but I guess in order to make sure tons of unused dependencies aren't installed on machines that don't need them as well as all the errors that crop up, it wasn't added. As a user who's simply using it for deployment and didn't need it for local development, I suppose this is what happens.
This commit is contained in:
2
app.py
2
app.py
@@ -8,7 +8,6 @@ from faker import Faker
|
||||
from flask import Flask, render_template, request
|
||||
from flask_login import LoginManager, current_user
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
# init SQLAlchemy
|
||||
from werkzeug.security import generate_password_hash
|
||||
|
||||
db = SQLAlchemy()
|
||||
@@ -23,6 +22,7 @@ def create_app():
|
||||
app.config['SECRET_KEY'] = 'secret key goes here'
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite'
|
||||
|
||||
# Heroku deployment
|
||||
if app.config['ENV'] == 'production':
|
||||
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY')
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URL').replace('postgres://', 'postgresql://', 1)
|
||||
|
||||
Reference in New Issue
Block a user