the two main types of request you'll use when building web apps are get requests and post requests you use get requests for pages that only read data from the server you usually use post requests when the user needs to submit information through form we'll be specifying the post method for processing all of our forms ( few other kinds of requests existbut we won' be using them in this project the function new_topic(takes in the request object as parameter when the user initially requests this pagetheir browser will send get request when the user has filled out and submitted the formtheir browser will submit post request depending on the requestwe'll know whether the user is requesting blank form ( get requestor asking us to process completed form ( post requestthe test at determines whether the request method is get or post if the request method is not postthe request is probably getso we need to return blank form (if it' another kind of requestit' still safe to return blank formwe make an instance of topicform vstore it in the variable formand send the form to the template in the context dictionary because we included no arguments when instantiating topicformdjango creates blank form that the user can fill out if the request method is postthe else block runs and processes the data submitted in the form we make an instance of topicform and pass it the data entered by the userstored in request post the form object that' returned contains the information submitted by the user we can' save the submitted information in the database until we've checked that it' valid the is_valid(function checks that all required fields have been filled in (all fields in form are required by defaultand that the data entered matches the field types expected--for examplethat the length of text is less than charactersas we specified in models py in this automatic validation saves us lot of work if everything is validwe can call save(ywhich writes the data from the form to the database once we've saved the datawe can leave this page we use reverse(to get the url for the topics page and pass the url to httpresponseredirect(zwhich redirects the user' browser to the topics page on the topics pagethe user should see the topic they just entered in the list of topics the new_topic template now we make new template called new_topic html to display the form we just creatednew_topic html {extends "learning_logs/base html%{block content %add new topic