{{ request.query_params }}

Object containing all of the query string parameters for the current page.
Specific parameters may be accessed by their keys using the bracket notation {{ request.query_params['parameter-name'] }}.
This object may be iterated using the {% for queryparameter in request.query_params %} syntax to loop through each query parameter on the current page.
If output directly to the page, the full query string will be displayed just as it is in the request.

Properties

Number count
The number of unique query parameters (IGNORING duplicate parameter names)
Number length
The total number of query parameters (INCLUDING duplicates parameter names AND empty parameters)

Query Parameter

Object representing one of the query parameters in the URL.
Note that a query parameter may have multiple values if the same key is repeated multiple times in the URL
If the query parameter's key is repeated multiple times in the URL, then outputting this directly to the page will display all of the values separated by commas
This object may be iterated using the {% for value in queryparameter %} syntax to loop through each of the values used with this key

Properties

String key
The part of the query parameter BEFORE the '=' (if present)
List values
A list containing all of the values for this query parameter (will typically only contain 1 value, but may contain more if the same key is repeated multiple times)
Number count
The number of times this query parameter's key was repeated (should typically be 1)
Number length
Alias for Count

Examples

For the URL: www.domain.com/path/to/page?alpha=abc&beta=b&&emptyvariable&animals=cat&animals=dog&animals=fish

{{ request.query_params }} alpha=abc&&emptyvariable&animals=cat&animals=dog&animals=fish {{ request.query_params.count }} 3 {{ request.query_params.length }} 6 {{ request.query_params['alpha'] }} abc {{ request.query_params['beta'] }} {{ request.query_params['emptyvariable'] }} {{ request.query_params['animals'] }} cat,dog,fish {{ request.query_params['alpha'].count }} 1 {{ request.query_params['beta'].count }} 0 {{ request.query_params['emptyvariable'].count }} 1 {{ request.query_params['animals'].count }} 3

Kitchen Sink

For the URL: www.domain.com/path/to/page?alpha=abc&&emptyvariable&animals=cat&animals=dog&animals=fish

<ul>{% for param in request.query_params %} <li><strong>{{ param.key }}</strong> <em>({{ param.count }})&tl;/em> = {{ param }} {% if param.count > 1 %} {% for val in param %}<br />{{ forloop.index }}: {{ val }}{% endfor %} {% endif %}</li> {% endfor %}</ul>

Results