Use production config, and resolve issue with postgres url format (Unsure why this only surfaced after recreation of app)

This commit is contained in:
Peter Stockings
2024-12-26 01:33:14 +11:00
parent 4a1655dd44
commit ef2529d56e
4 changed files with 14 additions and 6 deletions

View File

@@ -9,17 +9,17 @@ class DevelopmentConfig(Config):
"""Development configuration."""
DEBUG = True
uri = os.environ.get('DATABASE_URL', 'postgresql://postgres:59fff56880e1bbb42e753d2a82ac21b6@peterstockings.com:15389/bloodpressure_db')
uri = os.environ.get('DATABASE_URL', 'postgres://postgres:59fff56880e1bbb42e753d2a82ac21b6@peterstockings.com:15389/bloodpressure_db')
if uri and uri.startswith("postgres://"):
uri = uri.replace("postgres://", "postgresql://", 1)
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', 'postgresql://postgres:59fff56880e1bbb42e753d2a82ac21b6@peterstockings.com:15389/bloodpressure_db')
SQLALCHEMY_DATABASE_URI = uri
class ProductionConfig(Config):
"""Production configuration."""
DEBUG = False
uri = os.environ.get('DATABASE_URL', 'postgresql://postgres:59fff56880e1bbb42e753d2a82ac21b6@peterstockings.com:15389/bloodpressure_db')
uri = os.environ.get('DATABASE_URL', 'postgres://postgres:59fff56880e1bbb42e753d2a82ac21b6@peterstockings.com:15389/bloodpressure_db')
if uri and uri.startswith("postgres://"):
uri = uri.replace("postgres://", "postgresql://", 1)