Klaus-Uwe Mitterer
fb02819e36
Implemented RedirectViews Changed URL scheme for submodules Updated kumisms and ratesapi submodules
19 lines
697 B
Python
19 lines
697 B
Python
import importlib
|
|
|
|
from django.conf import settings
|
|
from django.urls import path
|
|
|
|
URLPATTERNS = []
|
|
APIPATTERNS = []
|
|
|
|
for module in settings.EXPEPHALON_MODULES:
|
|
try:
|
|
mou = importlib.import_module(f"{module}.urls")
|
|
if "ADMIN_URLS" in mou.__dict__.keys():
|
|
for url, action, name in mou.ADMIN_URLS:
|
|
URLPATTERNS.append(path(f'admin/modules/{module}/{url}', action, name=f"module_{module}_{name}"))
|
|
if "API_URLS" in mou.__dict__.keys():
|
|
for url, action, name in mou.API_URLS:
|
|
URLPATTERNS.append(path(f"api/modules/{module}/{url}", action, name=f"api_module_{module}_{name}"))
|
|
except ModuleNotFoundError:
|
|
pass
|