Mercurial > public > sg101
diff contests/views.py @ 679:89b240fe9297
For Django 1.5.2: import json; django.utils.simplejson is deprecated.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Thu, 15 Aug 2013 20:14:33 -0500 |
parents | ee87ea74d46b |
children | 16e190fa6ef8 |
line wrap: on
line diff
--- a/contests/views.py Wed Aug 14 14:53:21 2013 -0500 +++ b/contests/views.py Thu Aug 15 20:14:33 2013 -0500 @@ -2,10 +2,11 @@ Views for the contests application. """ +import json + from django.http import (HttpResponse, HttpResponseForbidden, HttpResponseBadRequest) from django.shortcuts import get_object_or_404 -from django.utils import simplejson from django.views.decorators.http import require_POST from contests.models import Contest @@ -42,5 +43,5 @@ result['entered'] = True result['msg'] = 'You have been entered into this contest!' - json = simplejson.dumps(result) - return HttpResponse(json, content_type='application/json') + json_result = json.dumps(result) + return HttpResponse(json_result, content_type='application/json')