{ "info": { "author": "wujinjing", "author_email": "schecterfirst@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "# django-request-context\n\nDjango middleware which provide request and g object.\n all of which are accessible everywhere, and thread isolation, just like used in flask. \n\n## Installing\n\nInstall and update using pip:\n\n```\npip install django-request-context\n```\n\n\n## Usage\n\n 1. Add RequestContextMiddleware to MIDDLEWARE in settings.py\n \n ```\n import django_request_context\n \n MIDDLEWARE = [\n ...\n 'django_request_context.RequestContextMiddleware',\n ...\n ] \n ``` \n \n 2. You can get request and g objects anywhere in the project throughout the life cycle of the request.\n just import:\n```\nfrom django_request_context import request, g\n```\n\n \n## why do you need this?\nwhen your django project is big enough and the function call stack is deep.\nif your want to get request object in the bottom of the call stack,\nyou need to transfer request as parameters layer-by-layer, this can help you get request directly.\nthe request you import from django-request-context is **readonly** object,\nif your want to convey some message you can user g object, this is a **writeable** object.\nthe behavior of the request and g objects is exactly the same as in the flask.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/schecterdamien/django-request-context", "keywords": "django request-context global-request", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-request-context", "package_url": "https://pypi.org/project/django-request-context/", "platform": "", "project_url": "https://pypi.org/project/django-request-context/", "project_urls": { "Homepage": "https://github.com/schecterdamien/django-request-context" }, "release_url": "https://pypi.org/project/django-request-context/0.1.0/", "requires_dist": null, "requires_python": ">=3.4.1", "summary": "Django middleware which provide request and g objectall of which are accessible everywhere, and thread isolation, just like used in flask.", "version": "0.1.0" }, "last_serial": 4439803, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e0ac0ee050c33a5b070232bcc6259376", "sha256": "4b004431614078f9ee3f406c42befc68232db5ef26d33b5d20fa2061ca859ebf" }, "downloads": -1, "filename": "django-request-context-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e0ac0ee050c33a5b070232bcc6259376", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.1", "size": 3593, "upload_time": "2018-11-01T08:04:08", "url": "https://files.pythonhosted.org/packages/c5/64/28edde68a05a6654b1fe407a724cc2cf83167642c2cebc0155a9054978f2/django-request-context-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e0ac0ee050c33a5b070232bcc6259376", "sha256": "4b004431614078f9ee3f406c42befc68232db5ef26d33b5d20fa2061ca859ebf" }, "downloads": -1, "filename": "django-request-context-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e0ac0ee050c33a5b070232bcc6259376", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.1", "size": 3593, "upload_time": "2018-11-01T08:04:08", "url": "https://files.pythonhosted.org/packages/c5/64/28edde68a05a6654b1fe407a724cc2cf83167642c2cebc0155a9054978f2/django-request-context-0.1.0.tar.gz" } ] }