{ "info": { "author": "Launchpad developers", "author_email": "launchpad-dev@lists.launchpad.net", "bugtrack_url": null, "classifiers": [], "description": "timeline_django\n===============\n\ntimeline_django inserts actions in to a `Timeline`\n(http://pypi.python.org/pypi/timeline/) for Django db queries, and other events\nin Django. This is very useful for obtaining a holistic view of the blocking\nwork and callouts involved in an individual Django request.\n\nThe usual pattern is to use this with `python-oops` - this README assumes you\nalready have WSGI based OOPS reporting configured for your Django application.\n\nWSGI\n----\n\nRunning under wsgi is assumed (as mod_python is deprecated, and the dev and\ntest servers in 1.4 and above are wsgi based. Some assembly may be required to\nrun in a non-WSGI environment.\n\nThere are three necessary steps to configure timeline-django.\n\nWSGI middleware\n+++++++++++++++\n\nPut this in your WSGI application somewhere after your Django app definition\nbut before the oops_wsgi wrapper is applied::\n\n from timeline_django.wsgi import make_app as timeline_django_make_app\n from timeline.wsgi import make_app as timeline_make_app\n application = timeline_django_make_app(application)\n application = timeline_make_app(application)\n\nThe first wrapper exposes the WSGI environ to Django code that runs without a\nrequest context - such as Django hooks which is where we catch ORM events.\n\nThe second wrapper injects a Timeline object into the WSGI environment.\n\nHook into Django events\n+++++++++++++++++++++++\n\nPut this anywhere where it will run exactly once (e.g. in your WSGI application\ndefinition)::\n\n from timeline_django import setup\n setup.setup_for_requests()\n\nRedaction\n+++++++++\n\nFinally, you need to ensure that the content of queries that can leak security\nor personal information are redacted: this prevents session hijacking and \nprivilege escalation attacks, making it safer for non-admin staff such as\ndevelopers to see your timeline data::\n\n import oops_timeline\n import timeline_django.filters\n oops_timeline.install_hooks(oops_config)\n timeline_django.filters.install_hooks(oops_config)\n\nThe oops_timeline hook copies the timeline from the WSGI environ to the OOPS\nreport, and the second one installs Django specific redaction filters that\noperate on the copied timeline - the ordering is important. The current\nfilters provided by timeline_django are::\n\n * ``session`` table to prevent session hijacking\n * ``user`` table to prevent password disclosure\n\nIf your Django site uses other sensitive tables (e.g. alternative\nauthentication modules) you should arrange to filter them as well. See\n``timeline_django.filters`` for example code.\n\nIf you are not using timeline with `python-oops` you will need to arrange\nredaction for whatever timeline capture/view system you are using.\n\nNon-WSGI environments\n---------------------\n\nIf you are running in other environments you need to do some of these steps\nyourself. First you need to pick a point to create a new `Timeline` object.\nThis needs to correspond to the start of an timeline that you want to\ncapture. That may be at the start of a script, or it may be in response to\nsome other event.\n\nOnce you have created the `Timeline` you need to store it somewhere it can\nbe accessed when needed. That may be in a variable, or it may be in\nthread-local storage if you will have multiple threads handling separate\ntimelines. Once you have the `Timline` stored you need a function that\nwill return it. That function will be your `timeline_factory`. It should take\nno arguments and return a `Timeline` object, or `None` if there is no\napplicable `Timeline` when it is called.\n\nOnce you have that method then you can call `timeline_django`'s setup_for_requests\nmethod::\n\n from timeline_django.setup import setup_for_requests\n\n setup_for_requests(timeline_factory=timeline_factory)\n\nwhere `timeline_factory` is the function you created above. That will set up the\nhooks necessary to have an action recorded in your timeline when there is\na DB query, or one of the other Django events that `timeline_django` supports.\n\n..\n\n Copyright (c) 2012, Canonical Ltd\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, version 3 only.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with this program. If not, see .\n GNU Lesser General Public License version 3 (see the file LICENSE).", "description_content_type": null, "docs_url": null, "download_url": "https://launchpad.net/python-timeline-django/+download", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://launchpad.net/python-timeline-django", "keywords": null, "license": "LGPLv3", "maintainer": null, "maintainer_email": null, "name": "timeline_django", "package_url": "https://pypi.org/project/timeline_django/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/timeline_django/", "project_urls": { "Download": "https://launchpad.net/python-timeline-django/+download", "Homepage": "http://launchpad.net/python-timeline-django" }, "release_url": "https://pypi.org/project/timeline_django/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Insert Django database queries in to a Timeline", "version": "0.0.3" }, "last_serial": 1209236, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "286fec36bc7a4b455f4c24dcfa71e1f1", "sha256": "7855091f6de1891b498dfa76a39468144485106f1f85b8f99d0040ef7a7f2633" }, "downloads": -1, "filename": "timeline_django-0.0.1.tar.gz", "has_sig": true, "md5_digest": "286fec36bc7a4b455f4c24dcfa71e1f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12617, "upload_time": "2012-02-28T18:57:37", "url": "https://files.pythonhosted.org/packages/7e/91/b70b6c0db465609262e12701076596b339ed947193766bddeb3be3f8e1a1/timeline_django-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "910c85cbd4964a2c17c7c4612a1521ed", "sha256": "d90a993457edca4451f55563769f157408943591094fecd7652fb36d46cc25b0" }, "downloads": -1, "filename": "timeline_django-0.0.2.tar.gz", "has_sig": true, "md5_digest": "910c85cbd4964a2c17c7c4612a1521ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14001, "upload_time": "2012-09-22T11:12:01", "url": "https://files.pythonhosted.org/packages/8e/f6/6b7f2bbf74aaaa796fcef2d54b8883899042f0b1e13744a52d268c05b99b/timeline_django-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "fc828a66272a7337e0fe7fe8fffba664", "sha256": "a38d043e6438609a416d1983108399a53cbe3ac40cfeda911b22dbbb5f9a37cc" }, "downloads": -1, "filename": "timeline_django-0.0.3.tar.gz", "has_sig": true, "md5_digest": "fc828a66272a7337e0fe7fe8fffba664", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14252, "upload_time": "2014-09-01T14:13:04", "url": "https://files.pythonhosted.org/packages/63/85/c95c3a4406cf5c95e2cbee7849db130b850f8273967e1ee1ad64a98cbe08/timeline_django-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fc828a66272a7337e0fe7fe8fffba664", "sha256": "a38d043e6438609a416d1983108399a53cbe3ac40cfeda911b22dbbb5f9a37cc" }, "downloads": -1, "filename": "timeline_django-0.0.3.tar.gz", "has_sig": true, "md5_digest": "fc828a66272a7337e0fe7fe8fffba664", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14252, "upload_time": "2014-09-01T14:13:04", "url": "https://files.pythonhosted.org/packages/63/85/c95c3a4406cf5c95e2cbee7849db130b850f8273967e1ee1ad64a98cbe08/timeline_django-0.0.3.tar.gz" } ] }