QueryStringer
Simple middleware for django to extract string queries from urls
Installation
pip install querystringer
Import
import it inside middleware in django settings
middlewares = [
...,
'querystringer.middleware.QueryStringer',
...,
]
Usage
all requests will have an edited request dict
and you can access them by request.GET['queries']
Example
our view
def home(request):
return HttpResponse(request.GET['queries'])
then send request to /home?test=true
now we should except output like this
('test', 'true')
Remove specific characters
in your settings.py add a list with QUERY_REMOVE_STRINGS name
to ignore characters you want
like this
QUERY_REMOVE_STRINGS = ['-', '>', '%']
then the data you get will be clean
like this
request to /home?test=tru>e
then we get (test, true)
Metadata
Release files for querystringer 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| querystringer-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for querystringer-0.0.2-py3-none-any.whl |
Release files / querystringer-0.0.2-py3-none-any.whl
| Download URL | querystringer-0.0.2-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
833165795c2e9e2509cb7799bed099ac87a1bd20203b98dabd88f13a20d96580
|
|
BLAKE2b-256 checksum How to use checksums |
5c52e69affeaec9fdd11000d2d87052e71b4f4c58888f1ccd632892c4535dde3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
|
Security for querystringer 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.