HTTP Response Codes
- The various response or status code are grouped by the type of success of failure they indicate
- 100-199: The server sends codes in this range to indicated protocol changes or more data is required. You don’t have to worry about these
- 200-299: A status code in this range indicates the successful handling of response
- 300-399: A status code in this range means page you are requesting has moved to other address (Redirection)
- 400-499: A status code in this range means that the request could not be handled as there was a problem with the client
- 500 – 599: Status codes in this range indicate that error is on servers side
- For more info Refer Here
- Create a new django project
bookreviewin a virtual environment
- Add an app called as
- open this project in pycharm
Processing a Request
- This is a basic time line of the request and response flows, so that you can get an idea of what code you will be writing does at each stage.
- In terms of writing the code, you will first write your view. The view you created will perform actions such as querying the database. This view will pass the data to another function to render a template and finally responds with HTTPResponse
- Django, needs to know how to map a specific URL to your view, so that it can load the correct view for the recieved URL.
- When Django receives a request, it parses the URL config file and then finds a corresponding view
- When we would like send the data along with the request one of the easier way of doing it is query string Refer Here
- Write a view in the project which takes principal, rate of interest and time and you view should return simple and compund intrest.
- Use query string to send the p,t,r