Moved webserver to Server and set up the webclient to work as a stand-alone program on the Portal side. The website link to the webclient is currently pointing to the wrong process, some way to direct that transparently to the Portal-side is needed.

This commit is contained in:
Griatch 2013-05-23 00:02:25 +02:00
parent 812bdb0f73
commit 94f50fcf33
7 changed files with 77 additions and 46 deletions

View file

@ -1,9 +1,9 @@
"""
This structures the url tree for the news application.
This structures the url tree for the news application.
It is imported from the root handler, game.web.urls.py.
"""
from django.conf.urls.defaults import *
from django.conf.urls import *
urlpatterns = patterns('src.web.news.views',
(r'^show/(?P<entry_id>\d+)/$', 'show_news'),

View file

@ -6,7 +6,7 @@
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
#
from django.conf.urls.defaults import *
from django.conf.urls import *
from django.conf import settings
from django.contrib import admin
from django.views.generic import RedirectView
@ -17,12 +17,12 @@ from django.db.models.loading import cache as model_cache
if not model_cache.loaded:
model_cache.get_models()
# loop over all settings.INSTALLED_APPS and execute code in
# loop over all settings.INSTALLED_APPS and execute code in
# files named admin.py in each such app (this will add those
# models to the admin site)
admin.autodiscover()
# Setup the root url tree from /
# Setup the root url tree from /
urlpatterns = patterns('',
# User Authentication
@ -36,11 +36,11 @@ urlpatterns = patterns('',
# Page place-holder for things that aren't implemented yet.
url(r'^tbi/', 'src.web.website.views.to_be_implemented'),
# Admin interface
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
url(r'^admin/', include(admin.site.urls)),
# favicon
url(r'^favicon\.ico$', RedirectView.as_view(url='/media/images/favicon.ico')),

View file

@ -1,6 +1,6 @@
"""
This structures the (simple) structure of the
webpage 'application'.
This structures the (simple) structure of the
webpage 'application'.
"""
from django.conf.urls import *

View file

@ -1,19 +1,25 @@
"""
This contains a simple view for rendering the webclient
This contains a simple view for rendering the webclient
page and serve it eventual static content.
"""
from django.shortcuts import render_to_response
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.conf import settings
from src.server.sessionhandler import SESSIONS
def webclient(request):
"""
Webclient page template loading.
"""
Webclient page template loading.
"""
# analyze request to find which port we are on
if int(request.META["SERVER_PORT"]) == 8000:
# we relay webclient to the portal port
print "Called from port 8000!"
#return redirect("http://localhost:8001/webclient/", permanent=True)
# as an example we send the number of connected players to the template
pagevars = {'num_players_connected': SESSIONS.player_count()}

View file

@ -1,9 +1,9 @@
"""
This structures the (simple) structure of the
webpage 'application'.
This structures the (simple) structure of the
webpage 'application'.
"""
from django.conf.urls.defaults import *
from django.conf.urls import *
urlpatterns = patterns('src.web.website.views',
(r'^$', 'page_index'),