示例#1
0
文件: views.py 项目: a1exsh/pgweb
def system_information(request):
	return render_to_response('core/system_information.html', {
			'server': uname()[1],
			'behind_cache': is_behind_cache(request),
			'cache_server': is_behind_cache(request) and request.META['REMOTE_ADDR'] or None,
			'client_ip': get_client_ip(request),
	})
示例#2
0
def system_information(request):
    return render_to_response(
        "core/system_information.html",
        {
            "server": os.uname()[1],
            "behind_cache": is_behind_cache(request),
            "cache_server": is_behind_cache(request) and request.META["REMOTE_ADDR"] or None,
            "client_ip": get_client_ip(request),
        },
    )
示例#3
0
文件: views.py 项目: a1exsh/pgweb
def robots(request):
	if not is_behind_cache(request):
		# If we're not serving this through one of our Varnish caches, we allow *nothing* to be indexed
		return HttpResponse("User-agent: *\nDisallow: /\n", mimetype='text/plain')
	else:
		# Regular website
		return HttpResponse("""User-agent: *
Disallow: /admin/
Disallow: /account/

Sitemap: http://www.postgresql.org/sitemap.xml
""", mimetype='text/plain')