Get the query string (query string) in Django

Implementation method when you want to process using query string in Django

python



qs = request.META['QUERY_STRING']

When the following query string is passed at the time of request, the above code ...

? __ search = true & access_dt_0 = & access_dt_1 = & access_user = 10000 & access_kb = & access_content =

The contents of qs are as follows.

<QueryDict: {'__search': ['true'], 'access_user': ['10000'], 'access_kb':
[''], 'access_dt_0': [''], 'access_dt_1': [''], 'access_content': ['Tesu
When']}>

In HttpRequest.META, HTTP headers are stored in the following dictionary, so it can be used in various other ways.

https://docs.djangoproject.com/en/1.10/ref/request-response/#django.http.HttpRequest.META

Recommended Posts

Get the query string (query string) in Django
Get the client's IP address in Django
Get query parameters for GET requests in Django
Get the desktop path in Python
Get the script path in Python
How to generate a query using the IN operator in Django
Switch the language displayed in Django 1.9
[Beginner] Get from Django Query database
Get parameter values ​​in Django templates
Get the value from the [Django] Form
Get the desktop path in Python
The meaning of ".object" in Django
In Django, how to abbreviate the long displayed string as ....
Get the host name in Python
Get the formula in an excel file as a string in Python
What's in the parameter? Edit String & Expression
Django ~ Let's display it in the browser ~
Get the top nth values in Pandas
I can't get the element in Selenium!
Escape curly braces in the format string
[PowerShell] Get the reading of the character string
Get only the text from the Django form.
Models in Django
Forms in Django
The _authenticate_with_backend function was obsolete in django auth.autenticate
[Python] Get the files in a folder with Python
Get the weather in Osaka via WebAPI (python)
The easiest way to get started with Django
Get the caller of a function in Python
Get only the subclass elements in a list
Get the X Window System window title in Python
How to get the files in the [Python] folder
Specify the view URL in your Django template
The story of viewing media files in Django
[Django] css in the project cannot be read
json.dumping None in python returns the string null
Use pygogo to get the log in json.
Test the number of times you have thrown a query (sql) in django
Get the last element of the array by splitting the string in Python and PHP
Check if the string is a number in python
Learning notes for the migrations feature in the Django framework (2)
How to get the variable name itself in python
Get the variable name of the variable as a character string.
How to get multiple model objects randomly in Django
Get the file name in a folder using glob
How to get the number of digits in Python
Get the GNOME version
I get a java.util.regex.PatternSyntaxException when splitting a string in PySpark
String manipulation in python
[Python] Get the numbers in the graph image with OCR
[python] Get the list of classes defined in the module
[Django] Perform Truncate Table (delete all data in the table)
Set the form DateField to type = date in Django
Get the result in dict format with Python psycopg2
When I checked the query generated by Django, it was issued in large numbers
Get the size (number of elements) of UnionFind in Python
Model changes in Django
Get the value selected in Selenium Python VBA pull-down
Shift the alphabet string by N characters in Python
Get date in Python
Learning notes for the migrations feature in the Django framework (1)