A
A
Anton Toropov2018-07-03 13:57:03
Django
Anton Toropov, 2018-07-03 13:57:03

Query string parameters in Django?

Good afternoon! Please tell me, I'm studying django, I got to the query string parameters and parameters that are passed through the url address! For example: localhost/index/3/Tom here parameters 3 and Tom are passed via url address, and here localhost/index?id=3&name=Tom , id=3 and name=Tom are query string parameters! It is not clear to me in what situation the user can transfer something through this or that, i.e. when is it used in practice and in which case is one and in which the other?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
sim3x, 2018-07-03
@tuychiev1988

these are the query string parameters
no - here are the get parameters
https://docs.djangoproject.com/en/2.0/intro/tutori...
Note that Django also provides request.GET for accessing GET data in the same way – but we're explicitly using request. POST in our code, to ensure that data is only altered via a POST call.

T
Tim, 2018-07-04
@darqsat

If I understand your question correctly, then you are wondering when the parameters are passed as parameters to the request and when they make up the URL itself.
From what I understand, parameters are optional. For example for sorting or filtering.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question