diff --git a/tunictracker/tracker/views.py b/tunictracker/tracker/views.py index 0a02988..c26e87c 100644 --- a/tunictracker/tracker/views.py +++ b/tunictracker/tracker/views.py @@ -5,10 +5,13 @@ from json import loads, dumps from math import floor import requests from .forms import ServerAddressForm +import logging # Create your views here. default_address = 'http://localhost:8000/spoiler' +# logging.basicConfig(encoding='utf-8', level=logging.DEBUG) + def index(request): request_data = None @@ -21,11 +24,15 @@ def index(request): # server_address = read_address['address']['default'] if 'listen_address' in request.session.keys(): server_address = request.session['listen_address'] - print(request.session['listen_address']) + + # TODO: consider serializing user sessions for debugging in the future. + logging.info( + f'Session listen address changed to: {server_address}') else: request.session['listen_address'] = default_address - print(request.session['listen_address']) server_address = default_address + logging.info( + f'Session listen address for {request.session} set to: {server_address}') is_hidden = True try: request_data = requests.get( @@ -107,7 +114,6 @@ def set_address(request): # la.write(dumps(listen_address)) server_address = form.cleaned_data['server_address_form'] request.session['listen_address'] = form.cleaned_data['server_address_form'] - print(request.session['listen_address']) return HttpResponseRedirect('/') else: form = ServerAddressForm()