django-ratchet is a simple middleware for reporting errors from Django apps to Ratchet.io.
Requirements
django-ratchet requires:
Python 2.6 or 2.7
Django 1.4+
requests 0.13.1+
a Ratchet.io account
Installation
Install using pip:
pip install django-ratchet
Configuration
Basic configuration requires two changes in your settings.py.
Add 'django_ratchet.middleware.RatchetNotifierMiddleware' as the last item in MIDDLEWARE_CLASSES:
MIDDLEWARE_CLASSES = ( # ... other middleware classes ... 'django_ratchet.middleware.RatchetNotifierMiddleware', )Add the RATCHET settings dictionary somewhere in settings.py. The bare minimum is:
RATCHET = { 'access_token': '32charactertokengoeshere', }
Most users will want a few extra settings to take advantage of more features:
RATCHET = { 'access_token': '32charactertokengoeshere', 'environment': 'production', 'branch': 'master', 'root': '/absolute/path/to/code/root', }To make the RATCHET settings available in your templates as ratchet_settings, add the context processor:
from django.conf import global_settings TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + ( 'django_ratchet.context_processors.ratchet_settings', )
Here’s the full list of configuration variables:
- access_token
Access token from your Ratchet.io project
- environment
Environment name. Any string up to 255 chars is OK. For best results, use “production” for your production environment.
default: development if settings.DEBUG is True, production otherwise
- handler
One of:
blocking – runs in main thread
thread – spawns a new thread
agent – writes messages to a log file for consumption by ratchet-agent
default: thread
- timeout
Request timeout (in seconds) when posting to Ratchet.
default: 1
- root
Absolute path to the root of your application, not including the final /. If your manage.py is in /home/brian/www/coolapp/manage.py, then this should be set to /home/brian/www/coolapp . Required for Github integration.
- branch
Name of the checked-out branch. Required for Github integration.
- agent.log_file
If handler is agent, the path to the log file. Filename must end in .ratchet
- endpoint
URL items are posted to.
default: https://submit.ratchet.io/api/1/item/
- web_base
Base URL of the Ratchet.io web interface. Used for “view in ratchet.io” links.
default: https://ratchet.io
- patch_debugview
If True, django.views.debug will be patched to show a “View in Ratchet.io” link on technical 500 debug error pages.
default: True
Contributing
Contributions are welcome. The project is hosted on github at http://github.com/ratchetio/django-ratchet
Additional Help
If you have any questions, feedback, etc., drop us a line at support@ratchet.io
Metadata
Release files for django-ratchet 0.3.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-ratchet-0.3.5.tar.gz | 6.5 kB | Without provenance | Details for django-ratchet-0.3.5.tar.gz |
Release files / django-ratchet-0.3.5.tar.gz
| Download URL | django-ratchet-0.3.5.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ead38e7d33f0bfcd58c1a9f1759a6ab64458df6a3c0c933534dc9fdd01fae38f
|
|
BLAKE2b-256 checksum How to use checksums |
7d02c0bb5ca78004e8050c1736f2366bb3b90d4fce9d792a41450d57e6cddf79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-ratchet 0.3.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.