2022-05-17 16:33:34 +02:00
|
|
|
import os
|
2022-05-15 21:20:05 +02:00
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
TESTING = False
|
|
|
|
DB_SERVER = "localhost"
|
|
|
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
|
|
|
SRC_DIR = BASE_DIR / "app"
|
|
|
|
EXCLUDED_DIRS = ["__pycache__", "commands"]
|
2023-01-14 17:38:03 +01:00
|
|
|
TIMEZONE = "Europe/Warsaw"
|
2022-05-19 18:15:11 +02:00
|
|
|
|
2023-01-14 17:38:03 +01:00
|
|
|
ENABLE_CORS = os.environ.get("ENABLE_CORS") or False
|
2022-05-15 21:20:05 +02:00
|
|
|
|
2023-01-14 17:38:03 +01:00
|
|
|
ALLOWED_EXTENSIONS = {"csv"}
|
2022-05-19 18:15:11 +02:00
|
|
|
MAX_CONTENT_LENGTH = 10 * 1024 * 1024 # 10 MB
|
|
|
|
|
2022-05-15 21:20:05 +02:00
|
|
|
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
|
|
SQLALCHEMY_DATABASE_URI = f'sqlite:///{BASE_DIR / "db.sqlite"}'
|
2022-06-13 22:58:52 +02:00
|
|
|
LIMIT_STUDENTS_PER_GROUP = 5
|
2022-11-17 18:39:45 +01:00
|
|
|
LIMIT_MEMBERS_PER_COMMITTEE = 3
|
2022-05-15 21:20:05 +02:00
|
|
|
|
2023-01-14 17:38:03 +01:00
|
|
|
DESCRIPTION = "System PRI"
|
|
|
|
OPENAPI_VERSION = "3.0.2"
|
2022-06-06 21:30:30 +02:00
|
|
|
|
2022-12-15 22:32:01 +01:00
|
|
|
# Weights for project grade sheet
|
|
|
|
PRESENTATION_WEIGHT_FIRST_TERM = 1.5
|
|
|
|
PRESENTATION_WEIGHT_SECOND_TERM = 1.5
|
|
|
|
DOCUMENTATION_WEIGHT_FIRST_TERM = 2
|
|
|
|
DOCUMENTATION_WEIGHT_SECOND_TERM = 1
|
|
|
|
GROUP_WORK_WEIGHT_FIRST_TERM = 3
|
|
|
|
GROUP_WORK_WEIGHT_SECOND_TERM = 3
|
|
|
|
PRODUCT_PROJECT_WEIGHT_FIRST_TERM = 3.5
|
|
|
|
PRODUCT_PROJECT_WEIGHT_SECOND_TERM = 4.5
|
|
|
|
|
2022-05-15 21:20:05 +02:00
|
|
|
|
|
|
|
class ProductionConfig(Config):
|
|
|
|
DB_SERVER = "0.0.0.0"
|
|
|
|
|
|
|
|
|
|
|
|
class DevelopmentConfig(Config):
|
2022-06-06 21:30:30 +02:00
|
|
|
DEBUG = True
|
2022-05-15 21:20:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TestingConfig(Config):
|
|
|
|
TESTING = True
|
|
|
|
SQLALCHEMY_DATABASE_URI = "sqlite:///:memory:"
|
|
|
|
|
|
|
|
|
|
|
|
config = {
|
|
|
|
"development": DevelopmentConfig,
|
|
|
|
"production": ProductionConfig,
|
|
|
|
"testing": TestingConfig,
|
|
|
|
}
|