Skip to main content

No project description provided

Project description

django_xss_protector

djago xss protector is a Python library for filtering incomming requests with malformed data in view level

Installation

Use the package manager pip to install django_xss_protector.

pip install django_xss_protector

import it in your view

from xss_protector.decorator import xss_protector 

filter all

@xss_protector()
def my_view(reqeust):
    ....

this will check everything, the url parameters, url querystring, request body and form data for possible xss data

filter some keys

@xss_protector("key1", "key2", "key3")
def my_view(reqeust):
    ....

this will check the url parameters, url querystring, request body and form data for possible xss data but only in the mentioned keys

exclude some keys

@xss_protector(lst_excluding_keys=["key1", "key2"])
def my_view(reqeust):
    ....

this will check the url parameters, url querystring, request body and form data for possible xss data but not in the mentioned keys

custome response

@xss_protector(response_on_error=JsonResponse({"ERROR": "custome error"})
def my_view(reqeust):
    ....

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-xss-protector-1.0.4.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_xss_protector-1.0.4-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file django-xss-protector-1.0.4.tar.gz.

File metadata

  • Download URL: django-xss-protector-1.0.4.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for django-xss-protector-1.0.4.tar.gz
Algorithm Hash digest
SHA256 7c9b146074b6adc8bb43479aca6268af5b06af91eafe51e988460bbcb5664707
MD5 74d4122cebdf0482d436ef4b45675bee
BLAKE2b-256 b31676166e8d45069583934d2af2a922a4505bff80666dc0fe09fe42ee31d342

See more details on using hashes here.

File details

Details for the file django_xss_protector-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for django_xss_protector-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2e81511577137f2e823714feb837a657d9f7975200aea24ba11c4d0bbdeeccd3
MD5 26f0cb672175b7a3dde98a2ea21ff338
BLAKE2b-256 2ebae55deb6ff34cc46fb5dc4c7f842a38082ffd7fc396ef2fd9c2a5a157baee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page