OpenSlides/openslides/config/urls.py

46 lines
1.0 KiB
Python
Raw Normal View History

2011-07-31 10:46:29 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
openslides.config.urls
2011-07-31 10:46:29 +02:00
~~~~~~~~~~~~~~~~~~~~~~
URL list for the config app.
2011-07-31 10:46:29 +02:00
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 import settings
from django.conf.urls.defaults import patterns, url
2012-03-16 14:31:59 +01:00
from django.utils.importlib import import_module
2011-07-31 10:46:29 +02:00
from openslides.config.views import GeneralConfig, VersionConfig
2012-02-15 12:04:11 +01:00
urlpatterns = patterns('',
2012-03-16 14:31:59 +01:00
url(r'^general/$',
GeneralConfig.as_view(),
name='config_general',
),
url(r'^version/$',
VersionConfig.as_view(),
name='config_version',
),
2012-03-16 14:31:59 +01:00
)
2012-02-15 12:04:11 +01:00
2012-03-16 14:31:59 +01:00
for app in settings.INSTALLED_APPS:
try:
mod = import_module(app + '.views')
except ImportError:
continue
appname = mod.__name__.split('.')[-2]
2012-03-16 14:31:59 +01:00
try:
urlpatterns += patterns('', url(
r'^%s/$' % appname,
mod.Config.as_view(),
name='config_%s' % appname,
))
except AttributeError:
continue
2012-02-15 12:04:11 +01:00