https://example.com/?year=2021&month=1
I want to take the values of the parameters year
and month
on the template side when accessing with.
When taking the value of year
{{ request.GET.year }}
Obtained at.
To take the value of month
{{ request.GET.month }}
Obtained at.
{% for key, value in request.GET.items %}
{{ key }} = {{ value }}
{% endfor %}
You can take it even if you turn it like this.
year = 2021 month = 1
Recommended Posts