2020-04-13 10:08:59 +00:00
|
|
|
import importlib
|
|
|
|
|
|
|
|
from django.conf import settings
|
|
|
|
from django.urls import path
|
|
|
|
|
2020-04-16 13:22:03 +00:00
|
|
|
URLPATTERNS = []
|
2020-06-03 16:23:00 +00:00
|
|
|
APIPATTERNS = []
|
2020-04-16 13:22:03 +00:00
|
|
|
|
2020-04-13 10:08:59 +00:00
|
|
|
for module in settings.EXPEPHALON_MODULES:
|
|
|
|
try:
|
|
|
|
mou = importlib.import_module(f"{module}.urls")
|
2020-06-03 16:23:00 +00:00
|
|
|
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}_{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}_{name}"))
|
|
|
|
except ModuleNotFoundError:
|
2020-04-13 10:08:59 +00:00
|
|
|
pass
|