Package: django-js-error-logging
The Django JS Error Logging is logging for Client-Side JavaScript errors.
You can log by the following three ways.Save to Django modelNotify by EmailLogging by python loggerInstallationAdd thejserrorloggingdirectory to your Python path.Can use pip command:$ pip install django-js-error-loggingAddjserrorloggingto yourINSTALLED_APPS.:INSTALLED_APPS = (
    # ...
    'jserrorlogging',
    # ...
)Add the following context processor to yourTEMPLATE_CONTEXT_PROCESSORS.:TEMPLATE_CONTEXT_PROCESSORS = (
    # ...
    'jserrorlogging.context_processors.static',
    # ...
)Add the following configuration to yoururls.py.:urlpatterns = patterns(
    # ...
    url(r'^jserr/$', include('jserrorlogging.urls', namespace='jserrorlogging')),
    # ...
)Add the following templatetag to head tag in your template.:<head>
# ...
{% include "jserrorlogging/includes/script.html" %}
# ...
</head>About more information of static files for Django,
you can see athttps://docs.djangoproject.com/en/dev/howto/static-files/.Add the following static files.Copystatic/jserrorloggingdirectory toSTATIC_ROOTor run the following command:$ python manage.py collectstaticRun syncdb.:$ python manage.py syncdbNote: When your project use South, run the following command.:$ python manage.py migrate jserrorloggingIf you don’t want to save to django model, don’t you run these commands.ConfigurationDjango JS Error Logging has the following optional settings.Save to Django modelYou can see results of logging in Admin site.This option is default enabled.
When you don’t need to this option,JSERRORLOGGING_ENABLE_MODELset to False.Notify by EmailYou can send results of logging to Email.This option is default enabled.
When you don’t need to this option,JSERRORLOGGING_ENABLE_MAILset to False.JSERRORLOGGING_MAIL_TODefault:settings.ADMINSYou can set the custom recipients for notification:JSERRORLOGGING_MAIL_TO = (
    ('someone', 'someone@example.com'),
)JSERRORLOGGING_MAIL_NOTIFY_INTERVALDefault:3600When the same errors occurred,
you can stop notification for the duration of this setting (seconds).Logging by python loggerYou can use Python’s builtin logger.This option is default disabled.
When you need to this option,JSERRORLOGGING_ENABLE_LOGGERset to True.
AndJSERRORLOGGING_LOGGER_NAMEset to your custom logger name.Example:LOGGING = {
    # ...
    'loggers': {
        # ...
        'jserror': {
            'handlers': ['console', 'mail_admins'],
            'level': 'INFO',
            'filters': ['special']
        },
        # ...
    }
    # ...
}

# ...

JSERRORLOGGING_ENABLE_MODEL = 'jserror'

# ...About more information of logging for Django,
you can see athttps://docs.djangoproject.com/en/dev/topics/logging/.Logging additional dataYou can log your custom data.For example, Django JS Error Logging has another template for the following additional data.django.contrib.auth.User.idrequest.session.session_keyWhen you want to log user_id and session_key, set the following templatetag:<head>
# ...
{% include "jserrorlogging/includes/script_with_user.html" %}
# ...
</head>If you want to log another data,
Create a template that extendsjserrorlogging/includes/script.htmland
editmeta_datablock.Example (path_to_your_template_dir/script_with_more_data.html):{% extends "jserrorlogging/includes/script.html" %}
{% block meta_data %}
djjserr.meta = {
    username: '{{ user.username }}',
    always_true: true
};
{% endblock %}Othersother configuration options.JSERRORLOGGING_LOG_MODELDefault: ‘jserrorlogging.Log’A name of model to save log.JSERRORLOGGING_STATIC_URLDefault: settings.STATIC_URL + ‘jserrorlogging/’A URL of script files for Django JS Error Logging.