Added a development helper page.

- Legacy-Id: 6251
This commit is contained in:
Henrik Levkowetz 2013-09-23 19:27:38 +00:00
parent 5d9e6c0b6a
commit 85e7af3370
2 changed files with 11 additions and 0 deletions

View file

@ -1,5 +1,7 @@
# Copyright The IETF Trust 2007, All Rights Reserved
import os
from django.template import RequestContext
from django.shortcuts import get_object_or_404, render_to_response
@ -29,3 +31,11 @@ def state(request, doc, type=None):
return render_to_response('help/states.html', {"doc": doc, "type": statetype, "states":states},
context_instance=RequestContext(request))
def environment(request):
if request.is_secure():
os.environ['SCHEME'] = "https"
else:
os.environ['SCHEME'] = "http"
os.environ["URL"] = request.build_absolute_uri(".")
return render_to_response('help/environment.html', {"env": os.environ},
context_instance=RequestContext(request))

View file

@ -83,4 +83,5 @@ if settings.SERVER_MODE in ('development', 'test'):
(r'^(?P<path>secretariat/(img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
(r'^(?P<path>robots\.txt)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT+"dev/"}),
(r'^_test500/$', lambda x: None),
(r'^environment/$', 'ietf.help.views.environment'),
)