OpenSlides/openslides/config/urls.py

47 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
:copyright: 2011 by the OpenSlides team, see AUTHORS.
:license: GNU GPL, see LICENSE for more details.
"""
from django.conf.urls.defaults import *
2012-03-16 14:31:59 +01:00
from django.utils.importlib import import_module
2011-07-31 10:46:29 +02:00
2012-03-16 14:31:59 +01:00
import settings
2012-02-15 12:04:11 +01:00
from views import GeneralConfig, VersionConfig
2012-02-15 12:04:11 +01:00
urlpatterns = patterns('config.views',
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('.')[0]
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