expephalon-kumisms/core/modules/urls.py
2020-04-13 12:08:59 +02:00

18 lines
No EOL
611 B
Python

import importlib
from django.conf import settings
from django.urls import path
URLPATTERNS = []
for module in settings.EXPEPHALON_MODULES:
try:
mou = importlib.import_module(f"{module}.urls")
for url, action, name in mou.ADMIN_URLS:
URLPATTERNS.append(path(f'admin/modules/{module}/{url}', action, name=f"{module}_{name}"))
except (AttributeError, ModuleNotFoundError):
pass
if "dbsettings" in settings.INSTALLED_APPS:
from core.views import DBSettingsListView
URLPATTERNS.append(path("admin/dbsettings/", DBSettingsListView.as_view(), name="dbsettings"))