Commit ac75d99a authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

webproject: Configurable webproject root url redirect

optionally append a redirect view to the root url of the project. Redirect url
is configurable using WEBPROJECT_ROOT_REDIRECT setting.
parent 3595ea09
......@@ -20,3 +20,7 @@
## Settings / cookies that should be 'cleansed'
#HIDDEN_SETTINGS = 'SECRET|PASSWORD|PROFANITIES_LIST|SIGNATURE|AMQP_HOSTS|PRIVATE_KEY|DB_CONNECTION'
#HIDDEN_COOKIES = 'password|_pithos2_a|token|sessionid|shibstate|shibsession|CSRF_COOKIE'
#
## Set the url you want to redirect users to when they access the root path of
## your site.
#WEBPROJECT_ROOT_REDIRECT = None
......@@ -38,7 +38,14 @@ from synnefo.util.entry_points import extend_urls
from django.utils.importlib import import_module
from django.conf import settings
urlpatterns = patterns('',
urlpatterns = patterns('')
ROOT_REDIRECT = getattr(settings, 'WEBPROJECT_ROOT_REDIRECT', None)
if ROOT_REDIRECT:
urlpatterns += patterns('django.views.generic.simple',
url(r'^$', 'redirect_to', {'url': ROOT_REDIRECT}))
urlpatterns += patterns('',
(r'^lang/$', 'synnefo.webproject.i18n.set_language')
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment