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'):
- if settings.DEBUG and key == '12345':
- submission = Submission.create(first_name = 'Debug', last_name = 'Debug', email = 'debug@debug.com', key = '12345')
+ if settings.DEBUG and key == DEBUG_KEY:
+ submission = Submission.create(first_name = 'Debug', last_name = 'Debug', email = 'debug@debug.com', key = DEBUG_KEY)
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':