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
|
|
|
from core.views import (
|
|
|
|
DashboardView,
|
|
|
|
LoginView,
|
|
|
|
OTPSelectorView,
|
|
|
|
LogoutView,
|
|
|
|
OTPValidatorView,
|
2020-04-18 13:02:41 +00:00
|
|
|
PWResetView,
|
2020-05-21 12:54:59 +00:00
|
|
|
PWRequestView,
|
2020-05-23 16:48:37 +00:00
|
|
|
RateLimitedView,
|
2020-04-16 13:22:03 +00:00
|
|
|
BackendNotImplementedView,
|
|
|
|
AdminListView,
|
|
|
|
AdminDeleteView,
|
|
|
|
AdminEditView,
|
|
|
|
AdminCreateView,
|
|
|
|
DBSettingsListView,
|
|
|
|
DBSettingsEditView,
|
|
|
|
DBSettingsDeleteView,
|
|
|
|
DBSettingsCreateView,
|
2020-05-31 12:08:26 +00:00
|
|
|
BrandCreateView,
|
|
|
|
BrandDeleteView,
|
|
|
|
BrandEditView,
|
|
|
|
BrandListView,
|
2020-04-16 13:22:03 +00:00
|
|
|
)
|
2020-04-15 20:19:03 +00:00
|
|
|
|
2020-04-16 13:22:03 +00:00
|
|
|
URLPATTERNS = []
|
|
|
|
|
|
|
|
# Auth URLs
|
|
|
|
|
|
|
|
URLPATTERNS.append(path('login/', LoginView.as_view(), name="login"))
|
|
|
|
URLPATTERNS.append(path('login/otp/select/', OTPSelectorView.as_view(), name="otpselector"))
|
|
|
|
URLPATTERNS.append(path('login/otp/validate/', OTPValidatorView.as_view(), name="otpvalidator"))
|
|
|
|
URLPATTERNS.append(path('logout/', LogoutView.as_view(), name="logout"))
|
2020-05-21 12:54:59 +00:00
|
|
|
URLPATTERNS.append(path('login/reset/', PWRequestView.as_view(), name="pwrequest"))
|
|
|
|
URLPATTERNS.append(path('login/reset/<pk>/', PWResetView.as_view(), name="pwreset"))
|
2020-05-23 16:48:37 +00:00
|
|
|
URLPATTERNS.append(path('login/ratelimit/', RateLimitedView.as_view(), name="ratelimited"))
|
2020-04-16 13:22:03 +00:00
|
|
|
|
|
|
|
# Base Backend URLs
|
|
|
|
|
|
|
|
URLPATTERNS.append(path('admin/', DashboardView.as_view(), name="dashboard"))
|
|
|
|
URLPATTERNS.append(path('admin/oops/', BackendNotImplementedView.as_view(), name="backendni"))
|
|
|
|
|
|
|
|
# Backend Database Settings URLs
|
|
|
|
|
|
|
|
URLPATTERNS.append(path("admin/dbsettings/", DBSettingsListView.as_view(), name="dbsettings"))
|
|
|
|
URLPATTERNS.append(path("admin/dbsettings/<pk>/delete/", DBSettingsDeleteView.as_view(), name="dbsettings_delete"))
|
|
|
|
URLPATTERNS.append(path("admin/dbsettings/<pk>/edit/", DBSettingsEditView.as_view(), name="dbsettings_edit"))
|
|
|
|
URLPATTERNS.append(path("admin/dbsettings/create/", DBSettingsCreateView.as_view(), name="dbsettings_create"))
|
|
|
|
|
|
|
|
# Backend User Administration URLs
|
|
|
|
|
|
|
|
URLPATTERNS.append(path('admin/profiles/', AdminListView.as_view(), name="admins"))
|
|
|
|
URLPATTERNS.append(path("admin/profiles/<pk>/delete/", AdminDeleteView.as_view(), name="admins_delete"))
|
|
|
|
URLPATTERNS.append(path("admin/profiles/<pk>/edit/", AdminEditView.as_view(), name="admins_edit"))
|
|
|
|
URLPATTERNS.append(path("admin/profiles/create/", AdminCreateView.as_view(), name="admins_create"))
|
|
|
|
|
2020-05-31 12:08:26 +00:00
|
|
|
# Brand Administration URLs
|
|
|
|
|
|
|
|
URLPATTERNS.append(path('admin/brands/', BrandListView.as_view(), name="brands"))
|
|
|
|
URLPATTERNS.append(path("admin/brands/<pk>/delete/", BrandDeleteView.as_view(), name="brands_delete"))
|
|
|
|
URLPATTERNS.append(path("admin/brands/<pk>/edit/", BrandEditView.as_view(), name="brands_edit"))
|
|
|
|
URLPATTERNS.append(path("admin/brands/create/", BrandCreateView.as_view(), name="brands_create"))
|
|
|
|
|
2020-04-16 13:22:03 +00:00
|
|
|
# External Module URLs
|
2020-04-13 10:08:59 +00:00
|
|
|
|
|
|
|
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
|