OpenSlides/openslides/urls.py

75 lines
1.8 KiB
Python
Raw Normal View History

2011-07-31 10:46:29 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.urls
~~~~~~~~~~~~~~~
Global URL list for OpenSlides.
2012-04-25 22:29:19 +02:00
:copyright: 2011, 2012 by OpenSlides team, see AUTHORS.
2011-07-31 10:46:29 +02:00
:license: GNU GPL, see LICENSE for more details.
"""
from django.conf.urls.defaults import patterns, url, include
#todo: use this in evry file
2011-07-31 10:46:29 +02:00
from django.conf import settings
from django.utils.importlib import import_module
import settings
2011-07-31 10:46:29 +02:00
2012-04-15 11:24:40 +02:00
from utils.views import FrontPage
2011-09-03 19:16:43 +02:00
handler500 = 'openslides.utils.views.server_error'
2011-07-31 10:46:29 +02:00
2012-04-16 11:12:21 +02:00
2011-07-31 10:46:29 +02:00
urlpatterns = patterns('',
# frontpage
2012-04-15 11:24:40 +02:00
(r'^$', FrontPage.as_view()),
(r'^agenda/', include('agenda.urls')),
(r'^application/', include('application.urls')),
(r'^assignment/', include('assignment.urls')),
(r'^participant/', include('participant.urls')),
(r'^config/', include('config.urls')),
2012-04-14 09:42:30 +02:00
(r'^projector/', include('projector.urls')),
2011-07-31 10:46:29 +02:00
(r'^i18n/', include('django.conf.urls.i18n')),
)
2011-09-03 19:16:43 +02:00
2012-04-16 11:12:21 +02:00
js_info_dict = {
'packages': [],
}
for plugin in settings.INSTALLED_PLUGINS:
try:
mod = import_module(plugin + '.urls')
except ImportError, err:
continue
plugin_name = mod.__name__.split('.')[0]
urlpatterns += patterns('', (r'^%s/' % plugin_name, include('%s.urls' % plugin_name)))
2012-04-16 11:12:21 +02:00
js_info_dict['packages'].append(plugin_name)
2011-09-03 19:16:43 +02:00
urlpatterns += patterns('',
(r'^500/$', 'openslides.utils.views.server_error'),
2012-04-16 11:12:21 +02:00
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
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',
),
url(r'^usersettings$',
'participant.views.user_settings',
name='user_settings',
),
2011-09-03 19:16:43 +02:00
)