{ "info": { "author": "Antoine Lefebvre-Brossard", "author_email": "antoine@protonmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Django :: 1.11", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "=============================\ndjango-cookies-samesite\n=============================\n\n.. image:: https://badge.fury.io/py/django-cookies-samesite.svg\n :target: https://badge.fury.io/py/django-cookies-samesite\n\n.. image:: https://travis-ci.org/jotes/django-cookies-samesite.svg?branch=master\n :target: https://travis-ci.org/jotes/django-cookies-samesite\n\n.. image:: https://codecov.io/gh/jotes/django-cookies-samesite/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/jotes/django-cookies-samesite\n\nDjango 2.1.x introduces support of SameSite flag for session and csrf cookie.\n\nUnfortunately, this functionality will not be ported to older versions of Django e.g. 1.11.x.\n\nThis repository contains a middleware which automatically sets SameSite attribute for session and csrf cookies in legacy versions of Django.\n\nQuickstart\n----------\n\nInstall django-cookies-samesite::\n\n pip install django-cookies-samesite\n\nAdd the middleware to the top of `MIDDLEWARE_CLASSES`:\n\n.. code-block:: python\n\n MIDDLEWARE_CLASSES = (\n 'django_cookies_samesite.middleware.CookiesSameSite',\n ...\n )\n\nSet your preferred SameSite policy in `settings.py`:\n\n.. code-block:: python\n\n SESSION_COOKIE_SAMESITE = 'Lax'\n\nThis can be 'Lax', 'Strict', or None to disable the flag.\n\nAlso, you can set this flag in your custom cookies:\n\n.. code-block:: python\n\n SESSION_COOKIE_SAMESITE_KEYS = {'my-custom-cookies'}\n\n\nAfter that you should be able to see SameSite flag set for session and csrf cookies:\n![screenshot]()\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n\n source /bin/activate\n (myenv) $ pip install tox\n (myenv) $ tox\n\nCredits\n-------\n\nTools used in rendering this package:\n\n* Cookiecutter_\n* `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n\n\n\n\nHistory\n-------\n\n0.1.0 (2018-05-16)\n++++++++++++++++++\n\n* First release on PyPI.\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/SALTISES4/django-cookies-samesite", "keywords": "django-cookies-samesite", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-cookies-samesite-fork", "package_url": "https://pypi.org/project/django-cookies-samesite-fork/", "platform": "", "project_url": "https://pypi.org/project/django-cookies-samesite-fork/", "project_urls": { "Homepage": "https://github.com/SALTISES4/django-cookies-samesite" }, "release_url": "https://pypi.org/project/django-cookies-samesite-fork/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Middleware which sets SameSite flag for session and csrf cookies in legacy versions of Django. Forked from https://pypi.org/project/django-cookies-samesite/", "version": "0.2.1" }, "last_serial": 5609594, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "29f64cd201fc814a6da5b70f95f3c22f", "sha256": "053540e7dad735423afb6307e7c23287072b517eb848a520251d7bfd1aace150" }, "downloads": -1, "filename": "django_cookies_samesite_fork-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "29f64cd201fc814a6da5b70f95f3c22f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5004, "upload_time": "2019-07-30T19:19:43", "url": "https://files.pythonhosted.org/packages/be/86/fec6096e064ca24a7d17f3ae71dd6e280fdda8e512e751d7ef9f77ce294e/django_cookies_samesite_fork-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "053c1faded35b0dc9fa3b5cf9adede70", "sha256": "7d064b2fd1e0b5aa3037a35c7907c9bccc5384f8899dc02412b947820e0acb59" }, "downloads": -1, "filename": "django-cookies-samesite-fork-0.2.1.tar.gz", "has_sig": false, "md5_digest": "053c1faded35b0dc9fa3b5cf9adede70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5154, "upload_time": "2019-07-30T19:19:46", "url": "https://files.pythonhosted.org/packages/bb/dc/2c72529dbca6610d11b7a5146d0b49c26edb347b9864f1e81d7999b4d6d3/django-cookies-samesite-fork-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "29f64cd201fc814a6da5b70f95f3c22f", "sha256": "053540e7dad735423afb6307e7c23287072b517eb848a520251d7bfd1aace150" }, "downloads": -1, "filename": "django_cookies_samesite_fork-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "29f64cd201fc814a6da5b70f95f3c22f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5004, "upload_time": "2019-07-30T19:19:43", "url": "https://files.pythonhosted.org/packages/be/86/fec6096e064ca24a7d17f3ae71dd6e280fdda8e512e751d7ef9f77ce294e/django_cookies_samesite_fork-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "053c1faded35b0dc9fa3b5cf9adede70", "sha256": "7d064b2fd1e0b5aa3037a35c7907c9bccc5384f8899dc02412b947820e0acb59" }, "downloads": -1, "filename": "django-cookies-samesite-fork-0.2.1.tar.gz", "has_sig": false, "md5_digest": "053c1faded35b0dc9fa3b5cf9adede70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5154, "upload_time": "2019-07-30T19:19:46", "url": "https://files.pythonhosted.org/packages/bb/dc/2c72529dbca6610d11b7a5146d0b49c26edb347b9864f1e81d7999b4d6d3/django-cookies-samesite-fork-0.2.1.tar.gz" } ] }