Various fixes to default config files

This commit is contained in:
Mattia Giambirtone 2022-10-05 15:46:01 +02:00
parent f1d04112d7
commit 185ca3f354
1 changed files with 12 additions and 1 deletions

View File

@ -1,7 +1,8 @@
# Configuration file. Each variable can be overridden by a
config.py.example# Configuration file. Each variable can be overridden by a
# corresponding environment variable
import os
import sys
import copy
import logging
import pathlib
@ -115,6 +116,7 @@ if __name__ != "__main__":
use_header=USE_BEARER_HEADER,
custom_exception=NotAuthenticated,
)
UNVERIFIED_MANAGER = copy.deepcopy(MANAGE
ADMIN_MANAGER = LoginManager(
LOGIN_SECRET_KEY,
"/admin",
@ -129,3 +131,12 @@ if __name__ != "__main__":
HOST = os.getenv("HOST") or "localhost"
PORT = int(os.getenv("PORT") or 0) or 8000
WORKERS = int(os.getenv("PORT") or 0) or 1
# Storage configuration
STORAGE_ENGINE = "database" # Stores media inside the database. Other options are "local" to use a local/remote folder
# or "url" for uploading to a CDN
STORAGE_FOLDER = "" # Only needed when STORAGE_ENGINE is set to local
MAX_MEDIA_SIZE = 5242880 # Max length of media allowed. Anything bigger raises a 415 HTTP Exception
ALLOWED_MEDIA_TYPES = ["gif", "png", "jpeg", "tiff"]
ZLIB_COMPRESSION_LEVEL = 9