{ "info": { "author": "Piotr Roszatycki", "author_email": "piotr.roszatycki@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": ".. image:: https://img.shields.io/pypi/v/django-csrf-protect-form.svg\n :target: https://pypi.python.org/pypi/django-csrf-protect-form\n.. image:: https://travis-ci.org/dex4er/django-csrf-protect-form.svg?branch=master\n :target: https://travis-ci.org/dex4er/django-csrf-protect-form\n.. image:: https://readthedocs.org/projects/django-csrf-protect-form/badge/?version=latest\n :target: http://django-csrf-protect-form.readthedocs.org/en/latest/\n.. image:: https://img.shields.io/pypi/pyversions/django-csrf-protect-form.svg\n :target: https://www.python.org/\n.. image:: https://img.shields.io/pypi/djversions/django-csrf-protect-form.svg\n :target: https://www.djangoproject.com/\n\ndjango-csrf-protect-form\n========================\n\nThe CSRF middleware and template tag from Django framework provides easy-to-use\nprotection against Cross Site Request Forgeries. This protector has some\ninconveniences for XHR POST requests.\n\nThis module enables CSRF protection only for HTML forms when content type of\nthe request is one of the following:\n\n* application/x-www-form-urlencoded\n* multipart/form-data\n* text/plain\n\nIt is generally safe to exclude XHR requests from CSRF protection, because XHR\nrequests can only be made from the same origin. Check your CORS configuration\nbefore using this module. Use `django-cors-headers\n`_ module to protect your site\nwith CORS.\n\n\nInstallation\n------------\n\nInstall with ``pip`` or ``pipenv``:\n\n.. code:: python\n\n pip install django-csrf-protect-form\n\n\nConfiguration\n-------------\n\nYou can set a list of content types which have CSRF protection enabled. The\ndefault value is:\n\n.. code:: python\n\n CSRF_PROTECT_FORM_CONTENT_TYPE = [\n 'application/x-www-form-urlencoded',\n 'multipart/form-data',\n 'text/plain',\n ]\n\n\nUsage\n-----\n\n**views.py**\n\n.. code:: python\n\n from django_csrf_protect_form import csrf_protect_form\n\n @csrf_protect_form\n def hello(request):\n return HttpResponse(\"Hello, world!\")\n\nor:\n\n**urls.py**\n\n.. code:: python\n\n from django_csrf_protect_form import csrf_protect_form\n from .views import hello\n\n urlpatterns = [\n url('hello/', csrf_protect_form(hello)),\n ]\n\n\nDocumentation\n-------------\n\nSee http://django-csrf-protect-form.readthedocs.org/\n\n\nLicense\n-------\n\nCopyright \u00a9 2019, Piotr Roszatycki\n\nThis software is distributed under the GNU Lesser General Public License (LGPL\n3 or greater).\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dex4er/django-csrf-protect-form", "keywords": "django html view csrf protect", "license": "LGPL", "maintainer": "", "maintainer_email": "", "name": "django-csrf-protect-form", "package_url": "https://pypi.org/project/django-csrf-protect-form/", "platform": "OS Independent", "project_url": "https://pypi.org/project/django-csrf-protect-form/", "project_urls": { "Homepage": "https://github.com/dex4er/django-csrf-protect-form" }, "release_url": "https://pypi.org/project/django-csrf-protect-form/0.1.0/", "requires_dist": [ "django (<2,>=1.11) ; python_version < \"3\"", "django (>=2) ; python_version >= \"3\"", "docutils ; extra == 'dev'", "Pygments ; extra == 'dev'" ], "requires_python": "", "summary": "Enable CSRF protection only for HTML forms", "version": "0.1.0" }, "last_serial": 5170905, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "74143d15dece57da586e0e952b12d3be", "sha256": "336e21f048b4e50423968c671faa55cb087d3a607b2943aa36710d9fa3c99151" }, "downloads": -1, "filename": "django_csrf_protect_form-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "74143d15dece57da586e0e952b12d3be", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6010, "upload_time": "2019-04-21T23:13:16", "url": "https://files.pythonhosted.org/packages/5f/58/342080ae544b33d529ec3b7e783c7e9b9bcff31e810b664945bcc591b9c3/django_csrf_protect_form-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7b0987096978fd26f6a38d7393f973c", "sha256": "49eef8a290a6bf1a66db3d49baeb792cb04ddc52ad5e7600f9ed40cebdbb2a8d" }, "downloads": -1, "filename": "django-csrf-protect-form-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d7b0987096978fd26f6a38d7393f973c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16787, "upload_time": "2019-04-21T23:13:18", "url": "https://files.pythonhosted.org/packages/6b/31/735050f43c2dedb1623844cc9636ed9eeb0a828d9d54a5a756a378c36464/django-csrf-protect-form-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "74143d15dece57da586e0e952b12d3be", "sha256": "336e21f048b4e50423968c671faa55cb087d3a607b2943aa36710d9fa3c99151" }, "downloads": -1, "filename": "django_csrf_protect_form-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "74143d15dece57da586e0e952b12d3be", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6010, "upload_time": "2019-04-21T23:13:16", "url": "https://files.pythonhosted.org/packages/5f/58/342080ae544b33d529ec3b7e783c7e9b9bcff31e810b664945bcc591b9c3/django_csrf_protect_form-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d7b0987096978fd26f6a38d7393f973c", "sha256": "49eef8a290a6bf1a66db3d49baeb792cb04ddc52ad5e7600f9ed40cebdbb2a8d" }, "downloads": -1, "filename": "django-csrf-protect-form-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d7b0987096978fd26f6a38d7393f973c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16787, "upload_time": "2019-04-21T23:13:18", "url": "https://files.pythonhosted.org/packages/6b/31/735050f43c2dedb1623844cc9636ed9eeb0a828d9d54a5a756a378c36464/django-csrf-protect-form-0.1.0.tar.gz" } ] }