browser-go-api/configuration/config.py

35 lines
814 B
Python
Raw Normal View History

2019-10-04 22:00:47 +00:00
import os
2019-10-04 18:24:11 +00:00
# local db
2019-10-12 05:23:38 +00:00
# ! Environment Variable
2019-10-04 18:24:11 +00:00
DATABASE = 'postgresql://localhost/browser-go'
class BaseConfig:
"""Base configuration."""
SECRET_KEY = os.getenv('SECRET_KEY')
DEBUG = False
BCRYPT_LOG_ROUNDS = 13
SQLALCHEMY_TRACK_MODIFICATIONS = False
class DevelopmentConfig(BaseConfig):
"""Development configuration."""
DEBUG = True
BCRYPT_LOG_ROUNDS = 4
SQLALCHEMY_DATABASE_URI = DATABASE
2019-10-07 20:55:43 +00:00
PORT = 5000
2019-10-04 18:24:11 +00:00
class TestingConfig(BaseConfig):
"""Testing configuration."""
DEBUG = True
TESTING = True
BCRYPT_LOG_ROUNDS = 4
SQLALCHEMY_DATABASE_URI = DATABASE
PRESERVE_CONTEXT_ON_EXCEPTION = False
class ProductionConfig(BaseConfig):
"""Production configuration."""
SECRET_KEY = ''
DEBUG = False
2019-10-12 05:23:38 +00:00
SQLALCHEMY_DATABASE_URI = 'postgresql:///'