Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.5.x] Fixed code examples in which render() calls were missing `req…

…uest` parameter.


5362134 from master.
  • Loading branch information...
commit 863e0ab57d44d6d0fb1d7dc887e16b2f2159931c 1 parent 64f1a17
Vinod Kurup vkurup authored ramiro committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 docs/topics/http/file-uploads.txt
4 docs/topics/http/file-uploads.txt
View
@@ -201,7 +201,7 @@ corresponding :class:`~django.db.models.FileField` when calling
return HttpResponseRedirect('/success/url/')
else:
form = ModelFormWithFileField()
- return render('upload.html', {'form': form})
+ return render(request, 'upload.html', {'form': form})
If you are constructing an object manually, you can simply assign the file
object from :attr:`request.FILES <django.http.HttpRequest.FILES>` to the file
@@ -221,7 +221,7 @@ field in the model::
return HttpResponseRedirect('/success/url/')
else:
form = UploadFileForm()
- return render('upload.html', {'form': form})
+ return render(request, 'upload.html', {'form': form})
``UploadedFile`` objects
Please sign in to comment.
Something went wrong with that request. Please try again.