OpenSlides/openslides/urls.py
2015-01-17 08:49:52 +01:00

69 lines
2.1 KiB
Python

from django.conf import settings
from django.conf.urls import include, patterns, url
from openslides.core.views import ErrorView
from openslides.utils.plugins import get_urlpatterns
from openslides.utils.rest_api import router
handler403 = ErrorView.as_view(status_code=403)
handler404 = ErrorView.as_view(status_code=404)
handler500 = ErrorView.as_view(status_code=500)
urlpatterns = []
js_info_dict = {'packages': []}
for plugin in settings.INSTALLED_PLUGINS:
plugin_urlpatterns = get_urlpatterns(plugin)
if plugin_urlpatterns:
urlpatterns += plugin_urlpatterns
js_info_dict['packages'].append(plugin)
urlpatterns += patterns(
'',
(r'^agenda/', include('openslides.agenda.urls')),
(r'^motion/', include('openslides.motion.urls')),
(r'^assignment/', include('openslides.assignment.urls')),
(r'^user/', include('openslides.users.urls')),
(r'^mediafile/', include('openslides.mediafile.urls')),
(r'^config/', include('openslides.config.urls')),
(r'^projector/', include('openslides.projector.urls')),
(r'^i18n/', include('django.conf.urls.i18n')),
(r'^ckeditor/', include('ckeditor.urls')),
)
urlpatterns += patterns(
'',
url(r'^api/', include(router.urls)),
# TODO: Remove the next line if you are sure.
# url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
)
# TODO: move this patterns into core or the participant app
from openslides.users.views import UserSettingsView, UserPasswordSettingsView
urlpatterns += patterns(
'',
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
url(r'^login/$',
'openslides.users.views.login',
name='user_login'),
url(r'^logout/$',
'django.contrib.auth.views.logout_then_login',
name='user_logout'),
url(r'^usersettings/$',
UserSettingsView.as_view(),
name='user_settings'),
url(r'^usersettings/changepassword/$',
UserPasswordSettingsView.as_view(),
name='password_change'),
)
urlpatterns += patterns(
'',
(r'^', include('openslides.core.urls')),
)