OpenSlides/openslides/urls.py

28 lines
960 B
Python
Raw Normal View History

from django.conf import settings
from django.conf.urls import include, url
from django.views.generic import RedirectView
from openslides.mediafiles.views import check_serve, protected_serve
from openslides.utils.rest_api import router
2012-04-15 11:24:40 +02:00
2018-08-22 06:22:28 +02:00
from .core import views as core_views
2018-08-22 06:22:28 +02:00
2018-10-13 08:41:51 +02:00
urlpatterns = [
2018-08-22 06:22:28 +02:00
# URLs for /media/
2019-01-06 16:22:33 +01:00
url(
r"^%s(?P<path>.*)$" % settings.MEDIA_URL.lstrip("/"),
protected_serve,
{"document_root": settings.MEDIA_ROOT},
),
url(r"^check-media/(?P<path>.*)$", check_serve),
# URLs for the rest system, redirect /rest to /rest/
url(r"^rest$", RedirectView.as_view(url="/rest/", permanent=True)),
2019-01-06 16:22:33 +01:00
url(r"^rest/", include(router.urls)),
2018-08-22 06:22:28 +02:00
# Other urls defined by modules and plugins
2019-01-06 16:22:33 +01:00
url(r"^apps/", include("openslides.urls_apps")),
2018-08-22 06:22:28 +02:00
# Main entry point for all angular pages.
# Has to be the last entry in the urls.py
2019-01-06 16:22:33 +01:00
url(r"^(?P<path>.*)$", core_views.IndexView.as_view(), name="index"),
]