from django.shortcuts import render
from django.utils import simplejson
from django.conf import settings
from django.shortcuts import render
from django.utils import simplejson
from django.conf import settings
from .forms import WTEMForm
WTEM_CONTEST_STAGE = getattr(settings, 'WTEM_CONTEST_STAGE', 'before')
from .forms import WTEMForm
WTEM_CONTEST_STAGE = getattr(settings, 'WTEM_CONTEST_STAGE', 'before')
if WTEM_CONTEST_STAGE != 'during':
if request.META['REMOTE_ADDR'] != getattr(settings, 'WTEM_CONTEST_IP_ALLOW', 'xxx'):
if WTEM_CONTEST_STAGE != 'during':
if request.META['REMOTE_ADDR'] != getattr(settings, 'WTEM_CONTEST_IP_ALLOW', 'xxx'):
submission = Submission.create(first_name = 'Debug', last_name = 'Debug', email = 'debug@debug.com', key = DEBUG_KEY)
else:
raise Http404
submission = Submission.create(first_name = 'Debug', last_name = 'Debug', email = 'debug@debug.com', key = DEBUG_KEY)
else:
raise Http404
if request.method == 'GET':
return render(request, 'wtem/main.html', dict(exercises = exercises))
elif request.method == 'POST':
if request.method == 'GET':
return render(request, 'wtem/main.html', dict(exercises = exercises))
elif request.method == 'POST':