{ "info": { "author": "Beau Sorensen", "author_email": "mail@beausorensen.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Django Client Errors\n\nAutomatic tracking of javascript errors for Django. Sends error information back to the \nserver to be persisted in the database, uses jQuery if available to send all information, \nfalling back to a GET request to send limited information.\n\n\n## Installation\n\n```bash\npip install django-client-errors\n````\n\nAlternatively, you can download the project and put the `client_errors` directory into \nyour project directory.\n\nAdd the following app to your project's `INSTALLED_APPS` in the `settings.py` file:\n\n````\n'client_errors',\n````\n\nAdd the following middleware to your project's `MIDDLEWARE_CLASSES` in the `settings.py` file:\n\n````\nclient_errors.middleware.ClientErrorMiddleware',\n````\n\nSince this module contains a model of its own, you must add it to the database schema:\n\n````\npython manage.py syncdb\n````\n\nOr, if you are using `south` to manage your project, you can run the following command,\nhowever, this is best to use only if you have included the source code inside of your project.\nOtherwise, it will attempt to add the migration to the egg directory.\n\n````\npython manage.py schemamigration client_errors\n````\n\nNote:\n\nTying into middleware allows each panel to be instantiated on request and\nrendering to happen on response.\n\nThe order of MIDDLEWARE_CLASSES is important: the Client Error middleware\nmust come after any other middleware that encodes the response's content\n(such as GZipMiddleware).\n\nIf you are using the `django_debug_toolbar`, the `client_error` middleware must\ncome after it.\n\nThe javascript will only be added if the mimetype of the\nresponse is either `text/html` or `application/xhtml+xml` and contains the selected\nhtml tag, the `` tag by default.\n\nNote: Be aware of middleware ordering and other middleware that may\nintercept requests and return responses. Putting the debug toolbar\nmiddleware *after* the Flatpage middleware, for example, means the\ntoolbar will not show up on flatpages.\n\n\n## Usage\n\nWhen an error occurs, the app will save the following information:\n\n* `created` current timestamp\n* `message` javascript error text\n* `url` where the error occurred\n* `loc` line of code\n* `os` user's operating system\n* `browser` user's browser\n* `version` user's browser version\n\nIf jQuery is found on the page, the app will send the following information as \nserialized JSON (not sent otherwise due to URL size constraints)\n\n* `plugins` list of browser enabled plugins\n* `device` user's device information\n* `locale` user's country and language\n\n\n## Example\n\nTo access the errors for a given user you could do something like this:\n\n```python\nfrom models import User\n\nuser = User.objects.get(pk=1)\nerrors = user.usererror_set.all()\n````\n\nIf you want to access the `plugins`, `device`, or `locale` fields, you will likely\nwant to deserialize them first for better use.\n\n```python\nfrom django.utils import simplejson\nfrom client_errors.models import UserError\n\nerror = UserError.objects.get(pk=1)\nlocale = simplejson.loads(error.locale)\ndevice = simplejson.loads(error.device)\nplugins = simplejson.loads(error.plugins)\n````\n\n\n## Output\n\n* `created` 2012-06-16 11:05:56\n* `created_by_id` 1 \n* `message` Uncaught ReferenceError: foo is not defined \n* `url` http://localhost:8000/app.js\n* `loc` 174 \n* `os` Mac \n* `browser` Chrome\n* `version` 19.0.1084.54\n* `plugins` {\"flash\":true,\"silverlight\":false,\"java\":true,\"quicktime\":true}\n* `device` {\"screen\":{\"width\":1280,\"height\":1024},\"viewport\":{\"width\":1308,\"height\":386},\"is_tablet\":false,\"is_phone\":false,\"is_mobile\":false}\n* `locale` {\"country\":\"us\",\"lang\":\"en\"}\n\n\n## Configuration\n\n* `CLIENT_ERRORS_USER` the user model to connect the errors to (optional, default `django.contrib.auth.models.User`)\n* `CLIENT_ERRORS_AUTO` automatic URL injection (optional, default `True`)\n* `CLIENT_ERRORS_MEDIA_ROOT` directory to serve the JS media from (optional)\n* `CLIENT_ERRORS_TAG` chosen tag to prepend the javascript to (optional, default ``)\n* `CLIENT_ERRORS_ENABLED` enable the module (optional, default `not DEBUG`)\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011-2012 Beau Sorensen \n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/sorensen/django-client-errors/downloads", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sorensen/django-client-errors", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-client-errors", "package_url": "https://pypi.org/project/django-client-errors/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-client-errors/", "project_urls": { "Download": "https://github.com/sorensen/django-client-errors/downloads", "Homepage": "https://github.com/sorensen/django-client-errors" }, "release_url": "https://pypi.org/project/django-client-errors/0.0.5/", "requires_dist": null, "requires_python": null, "summary": "Automatic javascript error tracking with browser and device information.", "version": "0.0.5" }, "last_serial": 455996, "releases": { "0.0.1": [], "0.0.2": [], "0.0.3": [], "0.0.4": [], "0.0.5": [] }, "urls": [] }