Mercurial > public > sg101
comparison membermap/views.py @ 1031:e1c03da72818
Get rid of some warnings in Django 1.8.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 20 Dec 2015 22:18:59 -0600 |
parents | 6164cc091649 |
children | 26f2b83e7468 |
comparison
equal
deleted
inserted
replaced
1030:d9610b1e2a3d | 1031:e1c03da72818 |
---|---|
2 Views for the membermap application. | 2 Views for the membermap application. |
3 | 3 |
4 """ | 4 """ |
5 import json | 5 import json |
6 | 6 |
7 from django.shortcuts import render_to_response | 7 from django.shortcuts import render |
8 from django.template.loader import render_to_string | 8 from django.template.loader import render_to_string |
9 from django.template import RequestContext | |
10 from django.http import HttpResponse | 9 from django.http import HttpResponse |
11 from django.http import HttpResponseBadRequest | 10 from django.http import HttpResponseBadRequest |
12 from django.http import HttpResponseForbidden | 11 from django.http import HttpResponseForbidden |
13 from django.views.decorators.http import require_POST | 12 from django.views.decorators.http import require_POST |
14 from django.core.cache import cache | 13 from django.core.cache import cache |
35 'location': entry.location, | 34 'location': entry.location, |
36 'message': entry.message}) | 35 'message': entry.message}) |
37 else: | 36 else: |
38 form = MapEntryForm() | 37 form = MapEntryForm() |
39 | 38 |
40 return render_to_response('membermap/index.html', { | 39 return render(request, 'membermap/index.html', { |
41 'form': form, | 40 'form': form, |
42 }, | 41 }) |
43 context_instance = RequestContext(request)) | |
44 | 42 |
45 | 43 |
46 def query(request): | 44 def query(request): |
47 """ | 45 """ |
48 This view is called by AJAX. If the user is logged in, return | 46 This view is called by AJAX. If the user is logged in, return |