{ "info": { "author": "Ryan Hiebert", "author_email": "ryan@ryanhiebert.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "Django Session Header: Identify the session through a header\n============================================================\n\nThere are some situations where the browser\nmay not allow any cookies at all to be used.\nIn those cases, we would like to be able to fall back\nto something that is both secure, and capable.\nThis package allows you to manually pass the\nsessionid using a header, so that you can continue\nto use Django's excellent session management.\n\nIt extends Django's built-in sessions to support\nsessions in places where cookies are not allowed.\nFor most views, the handling will be seamless.\nThose that need to have sessions that persist despite the\nabsence of cookies, there are a few extra features.\n\n\nUsage\n=====\n\nFirst, install the package.\n\n.. code-block:: sh\n\n pip install django-session-header\n\nReplace ``django.contrib.sessions.middleware.SessionMiddleware``\nin your ``settings.py`` with the following:\n\n.. code-block:: python\n\n MIDDLEWARE_CLASSES = [\n # ...\n # 'django.contrib.session.middleware.SessionMiddleware',\n 'django_session_header.middleware.SessionMiddleware',\n ]\n\nAnd replace the Django Rest Framework ``SessionAuthentication``\nclass with ``django_session_header.authentication.SessionAuthentication``:\n\n.. code-block:: python\n\n REST_FRAMEWORK = {\n 'DEFAUlT_AUTHENTICATION_CLASSES': [\n # ...\n # 'rest_framework.authentication.SessionAuthentication',\n 'django_session_header.authentication.SessionAuthentication',\n ]\n }\n\nIf a session was obtained via a session header,\nthen ``request.session.csrf_exempt`` will be ``True``.\nYou can use this to conditionally apply CSRF protection.\nOr, if you prefer, you can replace Django's normal CSRF middleware\nwith ``django_session_header.middleware.CsrfViewMiddleware``:\n\n.. code-block:: python\n\n MIDDLEWARE_CLASSES = [\n # ...\n # 'django.middleware.csrf.CsrfViewMiddleware',\n 'django_session_header.middleware.CsrfViewMiddleware',\n ]\n\nThe ``sessionid`` will be available in the ``X-SessionID`` response header,\nand you can now set the ``X-SessionID`` header on the request manually\nto avoid needing cookies to power your sessions.\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ryanhiebert/django-session-header", "keywords": "", "license": "MIT", "maintainer": "Ryan Hiebert", "maintainer_email": "ryan@ryanhiebert.com", "name": "django-session-header", "package_url": "https://pypi.org/project/django-session-header/", "platform": "", "project_url": "https://pypi.org/project/django-session-header/", "project_urls": { "Homepage": "https://github.com/ryanhiebert/django-session-header", "Repository": "https://github.com/ryanhiebert/django-session-header" }, "release_url": "https://pypi.org/project/django-session-header/1.0/", "requires_dist": [ "django (>=2.1,<3.0)", "djangorestframework (>=3.9,<4.0); extra == \"drf\"" ], "requires_python": ">=3.6,<4.0", "summary": "Identify the Django Session by a Header", "version": "1.0" }, "last_serial": 5000203, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "f86f7dcd45a1c5f2ef51a69e5cd810c7", "sha256": "683c940c8b2550a2ccf45ab58def563921f14ecb307746960b03ea3cac6b0f57" }, "downloads": -1, "filename": "django_session_header-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f86f7dcd45a1c5f2ef51a69e5cd810c7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 13095, "upload_time": "2019-03-28T21:24:40", "url": "https://files.pythonhosted.org/packages/f1/7b/65ec8d807c4d9d5bda1b4626e5dc5d5aeab8dc1577c83de6ea32bd2f0b4a/django_session_header-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8e7b791c58895d32f5a564625443c77", "sha256": "dcbffc01d21ffcf22344529142d320300f76d7de7d14ff2e9b29b830b5a6c54b" }, "downloads": -1, "filename": "django-session-header-1.0.tar.gz", "has_sig": false, "md5_digest": "c8e7b791c58895d32f5a564625443c77", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 4460, "upload_time": "2019-03-28T21:24:37", "url": "https://files.pythonhosted.org/packages/34/55/bea72634c423822c80b8142a68e1ffc5a5067c62e398546833ef3a6d2684/django-session-header-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f86f7dcd45a1c5f2ef51a69e5cd810c7", "sha256": "683c940c8b2550a2ccf45ab58def563921f14ecb307746960b03ea3cac6b0f57" }, "downloads": -1, "filename": "django_session_header-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f86f7dcd45a1c5f2ef51a69e5cd810c7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 13095, "upload_time": "2019-03-28T21:24:40", "url": "https://files.pythonhosted.org/packages/f1/7b/65ec8d807c4d9d5bda1b4626e5dc5d5aeab8dc1577c83de6ea32bd2f0b4a/django_session_header-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c8e7b791c58895d32f5a564625443c77", "sha256": "dcbffc01d21ffcf22344529142d320300f76d7de7d14ff2e9b29b830b5a6c54b" }, "downloads": -1, "filename": "django-session-header-1.0.tar.gz", "has_sig": false, "md5_digest": "c8e7b791c58895d32f5a564625443c77", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 4460, "upload_time": "2019-03-28T21:24:37", "url": "https://files.pythonhosted.org/packages/34/55/bea72634c423822c80b8142a68e1ffc5a5067c62e398546833ef3a6d2684/django-session-header-1.0.tar.gz" } ] }