Skip to content

request.Get.get() method

Dhiraj edited this page Mar 28, 2019 · 1 revision

The request object contains information about the user's request. What data they've sent to the page, where they are coming from, etc.

request.GET contains the GET variables. These are what you see in your browser's address bar. The .get() method is a method used for dictionaries. What your snippet of code is doing is saying, "Get the value of a GET variable with name 'page', and if it doesn't exist, return 1".

Likewise, you will see request.POST used when a user submits a form.

Clone this wiki locally