Use production config, and resolve issue with postgres url format (Unsure why this only surfaced after recreation of app)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from flask import Flask
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_migrate import Migrate
|
||||
@@ -13,9 +14,12 @@ login_manager = LoginManager()
|
||||
login_manager.login_view = 'auth.login'
|
||||
login_manager.login_message_category = 'info'
|
||||
|
||||
def create_app(config_class='app.config.DevelopmentConfig'):
|
||||
def create_app():
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config_class)
|
||||
|
||||
# Load configuration
|
||||
config_name = os.getenv('FLASK_CONFIG', 'DevelopmentConfig') # Default to DevelopmentConfig
|
||||
app.config.from_object(f'app.config.{config_name}')
|
||||
|
||||
# Initialize extensions
|
||||
db.init_app(app)
|
||||
|
||||
Reference in New Issue
Block a user