Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #212 from kevinlondon/ticket_18614_1_4

[1.4] Ticket 18614 -- Add Imports and change render_to_response to render
  • Loading branch information...
commit 498bf5c26cfba5e4c452501c82cfa8501cfc7d96 2 parents c2ff027 + c6d06a9
@apollo13 apollo13 authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 docs/topics/forms/index.txt
View
5 docs/topics/forms/index.txt
@@ -89,6 +89,9 @@ The standard pattern for processing a form in a view looks like this:
.. code-block:: python
+ from django.shortcuts import render
+ from django.http import HttpResponseRedirect
+
def contact(request):
if request.method == 'POST': # If the form has been submitted...
form = ContactForm(request.POST) # A form bound to the POST data
@@ -99,7 +102,7 @@ The standard pattern for processing a form in a view looks like this:
else:
form = ContactForm() # An unbound form
- return render_to_response('contact.html', {
+ return render(request, 'contact.html', {
'form': form,
})

0 comments on commit 498bf5c

Please sign in to comment.
Something went wrong with that request. Please try again.