معرفی شرکت ها


django-csp-nonce-1.0.0


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Nonce support for Content Security Policy in Django.
ویژگی مقدار
سیستم عامل -
نام فایل django-csp-nonce-1.0.0
نام django-csp-nonce
نسخه کتابخانه 1.0.0
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Bennyoak
ایمیل نویسنده benny@twosensedesign.com
آدرس صفحه اصلی http://github.com/Bennyoak/django-csp-nonce
آدرس اینترنتی https://pypi.org/project/django-csp-nonce/
مجوز MPL 2.0
Django-CSP-Nonce (beta) ======================= |Build Status| DCN is a Content-Security-Policy nonce injection support system for Django and CSP. | It provides for on-the-fly nonce creation and deployment. Once installed, DCN will generate a unique nonce | for each request (one for ``script-src`` and a separate one for ``style-src`` directives) append the nonce to the | CSP header, then make the nonce(s) accessible to the templates via the Django Context Processors. | DCN stays out of the way of `Django-CSP`_ and can operate | independently with any method of CSP insertion that passes through Django Middleware. Disclosure ---------- - This code has not been through a third party security audit. - I’ve successfully tested this locally with ``pypy-5.4.1``. TravisCI has confirmed this doesn’t work with their version. Installation ------------ ``pip install django-csp-nonce`` Add DCN to ``MIDDLEWARE_CLASSES``: .. code:: python MIDDLEWARE_CLASSES = ( [ ... ] 'csp_nonce.middleware.CSPNonceMiddleware', # Make sure you put it *above* django-csp if you're using it [ ... ] ) Add DCN to ``context_processors``: .. code:: python TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [...], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'csp_nonce.context_processors.nonce', [ ... ] ], }, }, ] Finally, add DCN directives to settings: .. code:: python CSP_NONCE_SCRIPT = False # True if you want to use it CSP_NONCE_STYLE = False # True if you want to use it CSP_FLAG_STRICT = False # True to include strict-dynamic in CSP Usage ----- DCN takes care of nonce generation for you. As you work on your templates, pull in your specific nonce from the context: .. code:: django <script type="text/javascript" {{ script_nonce }}> ... </script> <style {{ style_nonce }}> ... </style> Dependencies ------------ - Django Known issues ------------ - Nonce sync breaks on ``settings.DEBUG=True`` .. _Django-CSP: http://django-csp.readthedocs.io/en/latest/ .. |Build Status| image:: https://travis-ci.org/Bennyoak/django-csp-nonce.svg?branch=master :target: https://travis-ci.org/Bennyoak/django-csp-nonce Important Changes ----------------- - 1.0 - Out of beta! - PyNacl is no longer a dependency. (Moving forward the aim is to stay compatible with environments such as Google App Engine which don't support non-python extensions.) Running Tests ------------- Use ``tox`` to run the tests against multiple versions of Python that you have installed and multiple versions of Django. Please make sure that you run your tests against at least Python 2.7 and Python 3.5. .. code:: bash virtualenv venv . ./venv/bin/activate pip install tox tox


نیازمندی

مقدار نام
>=1.6 Django
xtr django-csp;
==1.0.1) mock
==1.4.6) pep8
==2.9.1) pytest
==2.9.1) pytest-django
==1.0.1) pytest-flakes
==1.0.6) pytest-pep8


نحوه نصب


نصب پکیج whl django-csp-nonce-1.0.0:

    pip install django-csp-nonce-1.0.0.whl


نصب پکیج tar.gz django-csp-nonce-1.0.0:

    pip install django-csp-nonce-1.0.0.tar.gz