xppl/xppl/config.py

34 lines
845 B
Python

"""The Application settings."""
from os import getenv, urandom
from os.path import abspath, dirname, isdir, join
BASEDIR = abspath(dirname(__file__))
class Base():
"""The base configuration."""
DEBUG = False
TESTING = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = 'rqlite+pyrqlite://localhost:4001/'
UPLOAD_FOLDER_COVER = join(BASEDIR, 'cover')
UPLOAD_FOLDER = join(BASEDIR, 'uploads')
LIGHT = not isdir(UPLOAD_FOLDER)
SECRET_KEY = getenv('SECRET_KEY')
class Production(Base):
"""The production configuration."""
ENV = 'production'
DOMAIN = 'https://book.vvvvvvaria.org'
class Development(Base):
"""The development configuration."""
ENV = 'development'
DEBUG = True
TESTING = True
DOMAIN = 'http://localhost'
SECRET_KEY = urandom(24).hex()