Skip to main content

Django expvar endpoint

Project description

[![Build Status](](
[![Coverage Status](](


[expvar]( compatible endpoint for django

`pip install django-expvar`, add `expvar` to `INSTALLED_APPS` and add
to your ``:

from expvar.views import ExpVarView


url('^debug/vars$', ExpVarView.as_view(), name='expvar'),

Then, accessing `/debug/vars` on your app will return a JSON dict with
the exposed variables, which you can use for monitoring, debugging,

By default, `expvar` reports commandline arguments and some basic
memory stats, just like the Go package. (currently, the particular
memory stats don't match up with what Go reports. That's being worked
on so tools like [expvarmon]( can
be used out of the box, but the Python and Go runtimes are not exactly

You can also easily expose other variables through the expvar
endpoint. In your django app, just add a `` file with some
classes that subclass `expvar.ExpVar` like so:

import expvar

class Example(expvar.ExpVar):
name = 'example'

def value(self):
return 42

In your django settings, you can optionally specify a `EXPVAR_SKIP`
variable with a list of apps to ignore (ie, any `` files in
those apps will be ignored).

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_expvar-0.1.0-py2.py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page