Initial commit
This commit is contained in:
59
config.py
Normal file
59
config.py
Normal file
@@ -0,0 +1,59 @@
|
||||
"""
|
||||
Project: PARTS Website
|
||||
Author: Edward Middleton-Smith
|
||||
Precision And Research Technology Systems Limited
|
||||
|
||||
Technology: Backend
|
||||
Feature: Configuration
|
||||
|
||||
Description:
|
||||
Configuration variables
|
||||
"""
|
||||
|
||||
# IMPORTS
|
||||
import os
|
||||
|
||||
# CLASSES
|
||||
class Config:
|
||||
DEBUG = False
|
||||
TESTING = False
|
||||
SECRET_KEY = os.getenv('KEY_SECRET_FLASK') # gen cmd: openssl rand -hex 32
|
||||
# Add other configuration variables as needed
|
||||
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI')
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
ID_AUTH0_CLIENT = os.getenv('ID_AUTH0_CLIENT')
|
||||
ID_AUTH0_CLIENT_SECRET = os.getenv('ID_AUTH0_CLIENT_SECRET')
|
||||
DOMAIN_AUTH0 = os.getenv('DOMAIN_AUTH0')
|
||||
ID_TOKEN_USER = 'user'
|
||||
is_included_VAT = True
|
||||
"""
|
||||
KEY_IS_INCLUDED_VAT = 'is_included_VAT'
|
||||
code_currency = 1
|
||||
KEY_CODE_CURRENCY = 'id_currency'
|
||||
code_region_delivery = 1
|
||||
KEY_CODE_REGION_DELIVERY = 'id_region_delivery'
|
||||
KEY_ID_CURRENCY = 'id_currency'
|
||||
KEY_ID_REGION_DELIVERY = 'id_region_delivery'
|
||||
"""
|
||||
id_currency = 1
|
||||
id_region_delivery = 1
|
||||
|
||||
class DevelopmentConfig(Config):
|
||||
DEBUG = True
|
||||
# Add development-specific configuration variables
|
||||
|
||||
class ProductionConfig(Config):
|
||||
# Add production-specific configuration variables
|
||||
pass
|
||||
|
||||
# Set the configuration class based on the environment
|
||||
# You can change 'development' to 'production' when deploying
|
||||
config_env = 'development'
|
||||
if config_env == 'development':
|
||||
app_config = DevelopmentConfig
|
||||
elif config_env == 'production':
|
||||
app_config = ProductionConfig
|
||||
else:
|
||||
raise ValueError("Invalid configuration environment")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user