{ "info": { "author": "Jarek \"jotes\" \u015amiejczak", "author_email": "poke@jotes.work", "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/jotes/django-cookies-samesite", "keywords": "django-cookies-samesite", "license": "", "maintainer": "", "maintainer_email": "", "name": "django-cookies-samesite", "package_url": "https://pypi.org/project/django-cookies-samesite/", "platform": "", "project_url": "https://pypi.org/project/django-cookies-samesite/", "project_urls": { "Homepage": "https://github.com/jotes/django-cookies-samesite" }, "release_url": "https://pypi.org/project/django-cookies-samesite/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Middleware which sets SameSite flag for session and csrf cookies in legacy versions of Django.", "version": "0.2.0" }, "last_serial": 4174256, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "721a0a86aa46e6cd4cab28069f8489fc", "sha256": "bf2907af7105152e50bcc2e308ce620289f4f74c38f27a55e753ad6e6c841705" }, "downloads": -1, "filename": "django_cookies_samesite-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "721a0a86aa46e6cd4cab28069f8489fc", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5218, "upload_time": "2018-05-17T08:02:45", "url": "https://files.pythonhosted.org/packages/80/57/ec502dc6533c2865b9867307860ca12afc24908be1d3e9a7f8f4c9894620/django_cookies_samesite-0.1.0-py2.py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "47587650c890e358b727af5abd5fca34", "sha256": "5426ca30e64205451cabd7ecff08dac03070424d658caf54f64025e04ed431e7" }, "downloads": -1, "filename": "django_cookies_samesite-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "47587650c890e358b727af5abd5fca34", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5236, "upload_time": "2018-05-17T08:05:33", "url": "https://files.pythonhosted.org/packages/90/05/4011856080e80ba80cfdd0472aef3838dc5ffaed2a8bb02b992914a94127/django_cookies_samesite-0.1.1-py2.py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d8587720bc6e6156cc62160f26e38d48", "sha256": "8ffb0d4703e2cac6a4bff7c0bfb80d4153995497676556442f01804fc9918ec5" }, "downloads": -1, "filename": "django_cookies_samesite-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d8587720bc6e6156cc62160f26e38d48", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 5264, "upload_time": "2018-05-17T11:32:52", "url": "https://files.pythonhosted.org/packages/a9/4b/e5ebfd968fcb277260700eea3c1c5b95a7b6eec10bf5e0ba77a91b1114ed/django_cookies_samesite-0.1.2-py2.py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a3090046f42f3ac3322d4cfa87acb99d", "sha256": "b393f8e2e1c758af952ea10afe44fe837a68a182119fdfbab2fa00f67deded0e" }, "downloads": -1, "filename": "django_cookies_samesite-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a3090046f42f3ac3322d4cfa87acb99d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5312, "upload_time": "2018-08-15T19:47:39", "url": "https://files.pythonhosted.org/packages/91/84/433c16e6ea97e2dae4052a951aff7cd727dc1994789c54b2e6d926489502/django_cookies_samesite-0.2.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a3090046f42f3ac3322d4cfa87acb99d", "sha256": "b393f8e2e1c758af952ea10afe44fe837a68a182119fdfbab2fa00f67deded0e" }, "downloads": -1, "filename": "django_cookies_samesite-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a3090046f42f3ac3322d4cfa87acb99d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5312, "upload_time": "2018-08-15T19:47:39", "url": "https://files.pythonhosted.org/packages/91/84/433c16e6ea97e2dae4052a951aff7cd727dc1994789c54b2e6d926489502/django_cookies_samesite-0.2.0-py2.py3-none-any.whl" } ] }