From 7fc4bccc609583a067913686e3106e311d4f454d Mon Sep 17 00:00:00 2001 From: root Date: Sun, 16 Dec 2012 13:38:33 -0500 Subject: fix server_host for html pages --- frontend/views.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'frontend/views.py') diff --git a/frontend/views.py b/frontend/views.py index 9fec138..9285a35 100644 --- a/frontend/views.py +++ b/frontend/views.py @@ -65,7 +65,7 @@ def bg(request): return render_to_response( 'backgrounds.html', { - 'SERVER_HOST': settings.SERVER_HOST, + 'SERVER_HOST': request.get_host(), 'SERVER_PORT': settings.SERVER_PORT, 'lowest_id': backgrounds[limit - 1].id, 'backgrounds': filtered_backgrounds, @@ -87,7 +87,7 @@ def topvideos(request): response = render_to_response( 'topvideos.html', { - 'SERVER_HOST': settings.SERVER_HOST, + 'SERVER_HOST': request.get_host(), 'SERVER_PORT': settings.SERVER_PORT, 'top_today': json.dumps(videos_response_list(top_today)), 'top_yesterday': json.dumps(videos_response_list(top_yesterday)), @@ -107,7 +107,7 @@ def directory(request): response = render_to_response( 'directory.html', { - 'SERVER_HOST': settings.SERVER_HOST, + 'SERVER_HOST': request.get_host(), 'SERVER_PORT': settings.SERVER_PORT, 'directory': json.dumps(r), } @@ -155,7 +155,7 @@ def profile(request, username): response = render_to_response( 'profile.html', { - 'SERVER_HOST': settings.SERVER_HOST, + 'SERVER_HOST': request.get_host(), 'SERVER_PORT': settings.SERVER_PORT, 'NAME': userprofile.nickname, 'UCNAME': userprofile.nickname.upper(), @@ -187,6 +187,8 @@ def roomlist(request): response = render_to_response( 'roomlist.html', { + 'SERVER_HOST': request.get_host(), + 'SERVER_PORT': settings.SERVER_PORT, 'ROOM_LIST': json.dumps(roomlist), } ) @@ -215,7 +217,7 @@ def room(request, roomname): response = render_to_response( 'room.html', { - 'SERVER_HOST': settings.SERVER_HOST, + 'SERVER_HOST': request.get_host(), 'SERVER_PORT': settings.SERVER_PORT, 'JS_PATH': jsPath, 'ROOM': sjroom.name.lower(), @@ -231,7 +233,7 @@ def faq(request): response = render_to_response( 'faq.html', { - 'SERVER_HOST': settings.SERVER_HOST, + 'SERVER_HOST': request.get_host(), 'SERVER_PORT': settings.SERVER_PORT, } ) -- cgit v1.2.3-70-g09d2