2017-05-31 02:38:59 +02:00
|
|
|
from contextlib import suppress
|
|
|
|
|
2022-04-04 01:13:48 +02:00
|
|
|
from channels.routing import URLRouter
|
2017-05-29 15:59:49 +02:00
|
|
|
from django.conf import settings
|
2023-11-05 18:47:20 +01:00
|
|
|
from django.conf.urls.static import static
|
2016-07-07 17:25:33 +02:00
|
|
|
from django.contrib import admin
|
2022-04-03 16:42:17 +02:00
|
|
|
from django.urls import include, path
|
2016-07-07 17:25:33 +02:00
|
|
|
|
2016-09-27 16:18:18 +02:00
|
|
|
import c3nav.api.urls
|
2017-12-08 14:48:37 +01:00
|
|
|
import c3nav.control.urls
|
2016-09-27 16:18:18 +02:00
|
|
|
import c3nav.editor.urls
|
2017-10-10 14:39:11 +02:00
|
|
|
import c3nav.mapdata.urls
|
2022-04-04 01:13:48 +02:00
|
|
|
import c3nav.mesh.urls
|
2016-12-13 20:17:56 +01:00
|
|
|
import c3nav.site.urls
|
2016-08-17 14:34:43 +02:00
|
|
|
|
2016-07-07 17:25:33 +02:00
|
|
|
urlpatterns = [
|
2022-04-03 16:33:43 +02:00
|
|
|
path('editor/', include(c3nav.editor.urls)),
|
2023-12-03 21:47:43 +01:00
|
|
|
path('api/', include(c3nav.api.urls)),
|
2022-04-03 16:33:43 +02:00
|
|
|
path('map/', include(c3nav.mapdata.urls)),
|
|
|
|
path('admin/', admin.site.urls),
|
|
|
|
path('control/', include(c3nav.control.urls)),
|
2023-11-09 15:52:55 +01:00
|
|
|
path('mesh/', include(c3nav.mesh.urls)),
|
2022-04-03 16:33:43 +02:00
|
|
|
path('locales/', include('django.conf.urls.i18n')),
|
|
|
|
path('', include(c3nav.site.urls)),
|
2023-11-05 18:47:20 +01:00
|
|
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
2017-05-29 15:59:49 +02:00
|
|
|
|
2022-04-04 01:13:48 +02:00
|
|
|
websocket_urlpatterns = [
|
|
|
|
path('mesh/', URLRouter(c3nav.mesh.urls.websocket_urlpatterns)),
|
|
|
|
]
|
|
|
|
|
2017-05-29 15:59:49 +02:00
|
|
|
if settings.DEBUG:
|
2017-05-31 02:38:59 +02:00
|
|
|
with suppress(ImportError):
|
2017-05-29 15:59:49 +02:00
|
|
|
import debug_toolbar
|
2022-04-03 16:33:43 +02:00
|
|
|
urlpatterns.insert(0, path('__debug__/', include(debug_toolbar.urls)))
|