forked from CGM_Public/pretix_original
Allow plugins to register URLs
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import importlib
|
||||||
|
from django.apps import apps
|
||||||
from django.conf.urls import include, url
|
from django.conf.urls import include, url
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@@ -19,6 +21,16 @@ if settings.DEBUG:
|
|||||||
url(r'^__debug__/', include(debug_toolbar.urls)),
|
url(r'^__debug__/', include(debug_toolbar.urls)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for app in apps.get_app_configs():
|
||||||
|
if hasattr(app, 'PretixPluginMeta'):
|
||||||
|
try:
|
||||||
|
urlmod = importlib.import_module(app.name + '.urls')
|
||||||
|
urlpatterns.append(
|
||||||
|
url(r'', include(urlmod, namespace='plugins'))
|
||||||
|
)
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
|
||||||
urlpatterns.append(
|
urlpatterns.append(
|
||||||
url(r'', include(pretix.presale.urls, namespace='presale'))
|
url(r'', include(pretix.presale.urls, namespace='presale'))
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user