from django.conf.urls import patterns, url
from django.conf import settings
-from .views import main, form
+from .views import main, form, form_during
urlpatterns = patterns('',
url(r'^$', main, name = 'wtem_main'),
+ url(r'^_test/(?P<key>.*)/$', form_during),
url(r'^(?P<key>.*)/$', form, name = 'wtem_form')
)
return render(request, 'wtem/main_after.html')
def form_during(request, key):
+
+ if WTEM_CONTEST_STAGE != 'during':
+ if request.META['REMOTE_ADDR'] != getattr(settings, 'WTEM_CONTEST_IP_ALLOW', 'xxx'):
+ raise Http404
+
try:
submission = Submission.objects.get(key = key)
except Submission.DoesNotExist: