Reshuffling the Evennia package into the new template paradigm.
This commit is contained in:
parent
2846e64833
commit
2b3a32e447
371 changed files with 17250 additions and 304 deletions
27
lib/web/webclient/views.py
Normal file
27
lib/web/webclient/views.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
"""
|
||||
This contains a simple view for rendering the webclient
|
||||
page and serve it eventual static content.
|
||||
|
||||
"""
|
||||
from django.shortcuts import render
|
||||
|
||||
from src.players.models import PlayerDB
|
||||
|
||||
|
||||
def webclient(request):
|
||||
"""
|
||||
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)
|
||||
|
||||
nsess = len(PlayerDB.objects.get_connected_players()) or "none"
|
||||
# as an example we send the number of connected players to the template
|
||||
pagevars = {'num_players_connected': nsess}
|
||||
|
||||
return render(request, 'webclient.html', pagevars)
|
||||
Loading…
Add table
Add a link
Reference in a new issue