Changes between Version 2 and Version 3 of searchengine
- Timestamp:
- Aug 15, 2006, 4:08:35 AM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
searchengine
v2 v3 44 44 45 45 if request.POST: 46 print printrequest.POST['term']46 print request.POST['term'] 47 47 return HttpResponseRedirect("/") 48 48 else: … … 62 62 When we enter the main page - http://localhost:8080/ we will see the form. When we enter a term and send the form we will be redirected to the main page. The form works. Note the: 63 63 {{{ 64 print printrequest.POST['term']64 print request.POST['term'] 65 65 }}} 66 66 in the view. You should see the term from the form in the terminal with running django server. '''request.POST''' is a dictionary like object which we can easily access (key is the form field name).