[Enhancement] Swappable Packages (#216)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#216
Reviewed-by: liambrydon <lbry121@aucklanduni.ac.nz>
Reviewed-by: Tobias O <tobias.olenyi@envipath.com>
This commit is contained in:
2025-11-14 21:42:39 +13:00
parent d584791ee8
commit a8554c903c
22 changed files with 239 additions and 179 deletions

View File

@ -49,9 +49,23 @@ INSTALLED_APPS = [
"oauth2_provider",
# Custom
"epdb",
"migration",
# "migration",
]
TENANT = os.environ.get("TENANT", "public")
if TENANT != "public":
INSTALLED_APPS.append(TENANT)
EPDB_PACKAGE_MODEL = os.environ.get("EPDB_PACKAGE_MODEL", "epdb.Package")
def GET_PACKAGE_MODEL():
from django.apps import apps
return apps.get_model(EPDB_PACKAGE_MODEL)
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
]