{ "info": { "author": "Filip Wasilewski", "author_email": "en@ig.ma", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "=================\ndjango-request-id\n=================\n\n\n.. image:: https://img.shields.io/pypi/l/dj-cmd.svg\n :target: https://raw.githubusercontent.com/nigma/django-request-id/master/LICENSE\n :alt: License\n\n.. image:: https://img.shields.io/pypi/v/django-request-id.svg\n :target: https://pypi.python.org/pypi/django-request-id/\n :alt: Latest PyPI version\n\n.. image:: https://img.shields.io/pypi/wheel/django-request-id.svg\n :target: https://pypi.python.org/pypi/django-request-id/\n :alt: Supports Wheel format\n\nAugments each request with unique ``request_id`` attribute and provides\nrequest id logging helpers.\n\nDeveloped and used at `en.ig.ma software shop `_.\n\n\nQuickstart\n----------\n\n1. Include ``django-request-id`` in your ``requirements.txt`` file.\n\n2. Add ``request_id`` to ``INSTALLED_APPS`` (necessary only if you are\n going to use the ``{% request_id %}`` template tag).\n\n3. Add ``request_id.middleware.RequestIdMiddleware`` at the top of\n the ``MIDDLEWARE`` Django setting.\n\n4. The app integrates with the standard Python/Django logging by defining\n a filter that puts a ``request_id`` variable in scope of every log message.\n\n First add a filter definition to the Django ``LOGGING`` settings:\n\n .. code-block:: python\n\n \"filters\": {\n \"request_id\": {\n \"()\": \"request_id.logging.RequestIdFilter\"\n }\n }\n\n Then enable the filter for related handlers:\n\n .. code-block:: python\n\n \"handlers\": {\n \"console\": {\n ...\n \"filters\": [\"request_id\"],\n }\n }\n\n And finally modify formatter output format to include the ``%(request_id)`` placeholder:\n\n .. code-block:: python\n\n \"formatters\": {\n \"console\": {\n \"format\": \"%(asctime)s - %(levelname)-5s [%(name)s] request_id=%(request_id)s %(message)s\"\n }\n }\n\n A full Django logging config example may look like this:\n\n .. code-block:: python\n\n\n LOGGING= {\n \"version\": 1,\n \"disable_existing_loggers\": False,\n \"filters\": {\n \"request_id\": {\n \"()\": \"request_id.logging.RequestIdFilter\"\n }\n },\n \"formatters\": {\n \"console\": {\n \"format\": \"%(asctime)s - %(levelname)-5s [%(name)s] request_id=%(request_id)s %(message)s\",\n \"datefmt\": \"%H:%M:%S\"\n }\n },\n \"handlers\": {\n \"console\": {\n \"level\": \"DEBUG\",\n \"filters\": [\"request_id\"],\n \"class\": \"logging.StreamHandler\",\n \"formatter\": \"console\"\n }\n },\n \"loggers\": {\n \"\": {\n \"level\": \"DEBUG\",\n \"handlers\": [\"console\"]\n }\n }\n }\n\n5. Make sure that your web server adds a ``X-Request-ID`` header to each request\n (and logs it in the server log for further matching of the server and app log entries).\n\n - Heroku handles this `automatically `_.\n - On Nginx you may require a separate module (see\n `nginx_requestid `_ or\n `nginx-x-rid-header `_).\n - On Apache you need to ``a2enmod`` the `unique_id `_\n module and set ``REQUEST_ID_HEADER = \"UNIQUE_ID\"`` in the Django project\n settings.\n\n If you can't generate the `X-Request-Id` header at the web server level then\n simply set ``REQUEST_ID_HEADER = None`` in your project settings and the\n app will generate a unique id value automatically instead of retrieving\n it from the wsgi environment.\n\n For more info on server configs see\n `server-config `_.\n\nDependencies\n------------\n\nNone.\n\nDocumentation and demo\n----------------------\n\nThe full documentation is at http://django-request-id.rtfd.org.\n\nThere's also an instant demo example that can be run from the cloned repository::\n\n python demo.py\n\nSee the integration in action on Heroku:\n\n.. image:: https://www.herokucdn.com/deploy/button.svg\n :alt: Deply\n :target: https://heroku.com/deploy?template=https://github.com/nigma/django-request-id\n\nLicense\n-------\n\n``django-request-id`` is released under the MIT license.\n\nOther Resources\n---------------\n\n- GitHub repository - https://github.com/nigma/django-request-id\n- PyPi Package site - http://pypi.python.org/pypi/django-request-id\n\n\nCommercial Support\n------------------\n\nThis app and many other help us build better software\nand focus on delivering quality projects faster.\nWe would love to help you with your next project so get in touch\nby dropping an email at en@ig.ma.\n\n\n\n\nHistory\n-------\n\n1.0.0 (2016-10-23)\n++++++++++++++++++\n\n* Django 1.10 compatibility\n\n\n0.1.0 (2014-01-30)\n++++++++++++++++++\n\n* First release\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nigma/django-request-id", "keywords": "django request-id", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-request-id", "package_url": "https://pypi.org/project/django-request-id/", "platform": "", "project_url": "https://pypi.org/project/django-request-id/", "project_urls": { "Homepage": "https://github.com/nigma/django-request-id" }, "release_url": "https://pypi.org/project/django-request-id/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Augment each request with unique id for logging purposes", "version": "1.0.0" }, "last_serial": 2418385, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f74344a4eacbd55ad7577b03436b0129", "sha256": "d7b18bde1e190ec1292e276c16403f95881b81c949114481dc902f1ee0766705" }, "downloads": -1, "filename": "django_request_id-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f74344a4eacbd55ad7577b03436b0129", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9652, "upload_time": "2014-01-30T17:08:16", "url": "https://files.pythonhosted.org/packages/59/55/dc9c489e4ce57589c61dbbf52ddcb9045630fa348c48854c85b199c7482d/django_request_id-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "38bce7dee965d3a5b307f66f36c6aa3d", "sha256": "af87929d7ec1960b74cd471b0f35831447a9c73ee4fe2628ae30037458143d39" }, "downloads": -1, "filename": "django-request-id-0.1.0.zip", "has_sig": false, "md5_digest": "38bce7dee965d3a5b307f66f36c6aa3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14576, "upload_time": "2014-01-30T17:08:11", "url": "https://files.pythonhosted.org/packages/0d/28/ce1a947d5a79fb5fe9f74d17118921acc33080299f8a4021582edfb1ec54/django-request-id-0.1.0.zip" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "a29ce4cf3039b57879b5734fcb808132", "sha256": "f7f296a7c6de44193af9461c72cbdb6a12887fffe00a7dcfa0f43a4ec67e4643" }, "downloads": -1, "filename": "django_request_id-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a29ce4cf3039b57879b5734fcb808132", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 11756, "upload_time": "2016-10-23T15:28:01", "url": "https://files.pythonhosted.org/packages/c2/ce/0455f018d3457a36a7bdd971b735fd7d0fd725ef203d0388ff6175766161/django_request_id-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "240a499fb9d0390200a11f61cc7c976d", "sha256": "0eb7ef17e21ff5efe5014e5b3cc6d22fc3396d4ea9d5b353bba2c43107998368" }, "downloads": -1, "filename": "django-request-id-1.0.0.tar.gz", "has_sig": false, "md5_digest": "240a499fb9d0390200a11f61cc7c976d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6619, "upload_time": "2016-10-23T15:27:57", "url": "https://files.pythonhosted.org/packages/97/60/386d2d55d606518482e2780034d03f2c6b444139a81403a74a723365965c/django-request-id-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a29ce4cf3039b57879b5734fcb808132", "sha256": "f7f296a7c6de44193af9461c72cbdb6a12887fffe00a7dcfa0f43a4ec67e4643" }, "downloads": -1, "filename": "django_request_id-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a29ce4cf3039b57879b5734fcb808132", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 11756, "upload_time": "2016-10-23T15:28:01", "url": "https://files.pythonhosted.org/packages/c2/ce/0455f018d3457a36a7bdd971b735fd7d0fd725ef203d0388ff6175766161/django_request_id-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "240a499fb9d0390200a11f61cc7c976d", "sha256": "0eb7ef17e21ff5efe5014e5b3cc6d22fc3396d4ea9d5b353bba2c43107998368" }, "downloads": -1, "filename": "django-request-id-1.0.0.tar.gz", "has_sig": false, "md5_digest": "240a499fb9d0390200a11f61cc7c976d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6619, "upload_time": "2016-10-23T15:27:57", "url": "https://files.pythonhosted.org/packages/97/60/386d2d55d606518482e2780034d03f2c6b444139a81403a74a723365965c/django-request-id-1.0.0.tar.gz" } ] }