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:
Xevion
2022-03-28 17:41:54 -05:00
parent f5f6f13756
commit 3ea945b99f
3 changed files with 20 additions and 2 deletions

2
app.py
View File

@@ -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)