mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00

settings.py: Add APPLICATION variable to switch between layerindex rrs also add context_processors decision layerindex or rrs. urls.py: Add decision for load urls for layerindex or rrs. layerindex/context_processors.py: Add application variable for use templates. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
32 lines
911 B
Python
32 lines
911 B
Python
# layerindex-web - URLs
|
|
#
|
|
# Based on the Django project template
|
|
#
|
|
# Copyright (c) Django Software Foundation and individual contributors.
|
|
# All rights reserved.
|
|
|
|
import settings
|
|
|
|
from django.conf.urls.defaults import patterns, include, url
|
|
from django.views.generic.simple import redirect_to
|
|
|
|
from django.contrib import admin
|
|
admin.autodiscover()
|
|
|
|
urlpatterns = patterns('',
|
|
url(r'^admin/', include(admin.site.urls)),
|
|
url(r'^accounts/', include('registration.backends.default.urls')),
|
|
url(r'^captcha/', include('captcha.urls')),
|
|
)
|
|
|
|
if settings.APPLICATION == 'layerindex':
|
|
urlpatterns += patterns('',
|
|
url(r'^layerindex/', include('layerindex.urls')),
|
|
url(r'.*', redirect_to, {'url' : '/layerindex/'}),
|
|
)
|
|
elif settings.APPLICATION == 'rrs':
|
|
urlpatterns += patterns('',
|
|
url(r'^rrs/', include('rrs.urls')),
|
|
url(r'.*', redirect_to, {'url' : '/rrs/'}),
|
|
)
|