Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

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,

You can easily expose 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).

If multiple variables declare the same `name`, two different things
can happen:

* if they return scalar values, it's a collision and only one of them
will get reported. This is probably not what you intended, so try to
stick to unique names
* if they return dicts as their value, variables with the same name
will have their values merged.

## plugins:

By default, `expvar` will only expose the variables that you set up.

There are a few additional packages available though that act as
plugins to provide generic data on commandline arguments, process
data, etc. Generally, once you have `expvar` installed, you can pip
install them and add them to `INSTALLED_APPS` and that's enough to use

* [django-expvar-cmdline]( -
reports the commandline data for the process (useful for
compatability with expvarmon and similar, but may pose a security
risk if you pass secrets on the commandline)
* [django-expvar-resource]( -
reports various info on resource usage (memory, interrupts, etc) via
a library in the Python's standard lib.

Release History

This version
History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(7.5 kB) Copy SHA256 Hash SHA256
Wheel 2.7 May 8, 2016

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers