2011-07-31 10:46:29 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
|
|
openslides.urls
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
Global URL list for OpenSlides.
|
|
|
|
|
|
|
|
:copyright: 2011 by the OpenSlides team, see AUTHORS.
|
|
|
|
:license: GNU GPL, see LICENSE for more details.
|
|
|
|
"""
|
|
|
|
|
2012-04-13 16:47:40 +02:00
|
|
|
from django.conf.urls.defaults import patterns, url, include
|
2011-07-31 10:46:29 +02:00
|
|
|
from django.conf import settings
|
2012-02-20 14:50:42 +01:00
|
|
|
from django.views.generic import RedirectView
|
2012-04-13 14:05:51 +02:00
|
|
|
from django.utils.importlib import import_module
|
|
|
|
import settings
|
2011-07-31 10:46:29 +02:00
|
|
|
|
2011-09-03 19:16:43 +02:00
|
|
|
handler500 = 'openslides.utils.views.server_error'
|
2011-07-31 10:46:29 +02:00
|
|
|
|
|
|
|
urlpatterns = patterns('',
|
2012-02-20 14:50:42 +01:00
|
|
|
# frontpage
|
|
|
|
(r'^$', RedirectView.as_view(
|
2012-03-06 08:19:49 +01:00
|
|
|
url='projector/control',
|
2012-02-20 14:50:42 +01:00
|
|
|
permanent = False,
|
|
|
|
)),
|
|
|
|
|
|
|
|
(r'^agenda/', include('agenda.urls')),
|
2012-04-13 21:43:16 +02:00
|
|
|
(r'^application/', include('application.urls')),
|
|
|
|
(r'^assignment/', include('assignment.urls')),
|
|
|
|
(r'^participant/', include('participant.urls')),
|
2012-04-14 09:42:30 +02:00
|
|
|
(r'^config/', include('system.urls')),
|
|
|
|
(r'^projector/', include('projector.urls')),
|
2011-07-31 10:46:29 +02:00
|
|
|
(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_DOC_ROOT}),
|
|
|
|
(r'^i18n/', include('django.conf.urls.i18n')),
|
|
|
|
)
|
2011-09-03 19:16:43 +02:00
|
|
|
|
2012-04-13 14:05:51 +02:00
|
|
|
for plugin in settings.INSTALLED_PLUGINS:
|
|
|
|
try:
|
|
|
|
mod = import_module(plugin + '.urls')
|
2012-04-13 16:47:40 +02:00
|
|
|
except ImportError, err:
|
2012-04-13 14:05:51 +02:00
|
|
|
continue
|
|
|
|
|
|
|
|
plugin_name = mod.__name__.split('.')[0]
|
|
|
|
urlpatterns += patterns('', (r'^%s/' % plugin_name, include('%s.urls' % plugin_name)))
|
|
|
|
|
2011-09-03 19:16:43 +02:00
|
|
|
|
|
|
|
urlpatterns += patterns('',
|
|
|
|
(r'^500/$', 'openslides.utils.views.server_error'),
|
2012-04-14 09:42:30 +02:00
|
|
|
|
|
|
|
url(r'^login/$',
|
|
|
|
'django.contrib.auth.views.login',
|
|
|
|
{'template_name': 'participant/login.html'},
|
|
|
|
name='user_login',
|
|
|
|
),
|
|
|
|
|
|
|
|
url(r'^logout/$',
|
|
|
|
'django.contrib.auth.views.logout_then_login',
|
|
|
|
name='user_logout',
|
|
|
|
)
|
2011-09-03 19:16:43 +02:00
|
|
|
)
|