30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
import os
|
||
import datetime
|
||
from local_config import DB_NAME
|
||
|
||
|
||
class Config(object):
|
||
SECRET_KEY = os.environ.get('SECRET_KEY') or 'a-random-secret-key'
|
||
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
|
||
'postgresql+psycopg2://' + os.environ.get('USER') + ':@/' + DB_NAME
|
||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||
UPLOAD_FOLDER = './app/static/avatars'
|
||
|
||
|
||
class V5Config(object):
|
||
# Length allocated to privilege names (slugs)
|
||
PRIVS_MAXLEN = 64
|
||
# Forbidden user names
|
||
FORBIDDEN_USERNAMES = ["admin", "root", "webmaster", "contact"]
|
||
# Unauthorized message (@priv_required)
|
||
UNAUTHORIZED_MSG = "Vous n'avez pas l'autorisation d'effectuer cette action !"
|
||
# Minimum and maximum user name length
|
||
USER_NAME_MINLEN = 3
|
||
USER_NAME_MAXLEN = 32
|
||
# Minimum password length for new users and new passwords
|
||
PASSWORD_MINLEN = 10
|
||
# Maximum thread name length
|
||
THREAD_NAME_MAXLEN = 32
|
||
# Remember-me cookie duration time
|
||
REMEMBER_COOKIE_DURATION = datetime.timedelta(days=7)
|