The above mentioned things are giving me almost the same results was wondering whats the main difference in them.
相关问题
- Django __str__ returned non-string (type NoneType)
- Django & Amazon SES SMTP. Cannot send email
- Django check user group permissions
- Django restrict pages to certain users
- UnicodeEncodeError with attach_file on EmailMessag
相关文章
- Profiling Django with PyCharm
- Why doesn't Django enforce my unique_together
- MultiValueDictKeyError in Django admin
- Django/Heroku: FATAL: too many connections for rol
- Django is sooo slow? errno 32 broken pipe? dcramer
- Django: Replacement for the default ManyToMany Wid
- Upgrading transaction.commit_manually() to Django
- UnicodeEncodeError when saving ImageField containi
response = HttpResponse("Here's the text of the Web page.")
:will create a new
HttpResponse
object with HTTP code 200 (OK), and the content passed to the constructor. In general, you should only use this for really small responses (like an AJAX form return value, if its really simple - just a number or so).HttpResponseRedirect("http://example.com/")
:will create a new
HttpResponse
object with HTTP code 302 (Found/Moved temporarily). This should be used only to redirect to another page (e.g. after successful form POST)From the docs:
enough said...
is a call to render a template with given dictionary of variables to create the response for you. This is what you should be using most of the time, because you want to keep your presentation logic in templates and not in code.