The primary prerequisite of MamaCAS is Django itself. MamaCAS supports the last two major release versions of Django and the current LTS release, generally following Django’s support policy. Other versions of Django may work, but are not officially tested or supported. See the Django downloads page for information on downloading and installing Django.

If you’re installing MamaCAS manually, such as from the GitHub repository, you’ll need to install the Requests and defusedxml libraries. The optional gevent module may also be installed to enable asynchronous single sign-out requests.


Installing the latest release is easiest with pip:

$ pip install django-mama-cas

To manually install the latest release, download it from PyPI and install with:

$ python install

If you need the latest development code, clone the active development repository on GitHub:

$ git clone git://


First, add MamaCAS to the INSTALLED_APPS setting within your project’s (or equivalent) file:

    # ...existing apps...

Once added, run migrate to create the required database tables.

URL paths

MamaCAS includes a Django URLconf that provides the required CAS URIs (e.g. login/, logout/, validate/, etc.). They are located in mama_cas.urls and can be included directly in your project’s root URLconf with the following:

urlpatterns = patterns('',
    # ...existing urls...
    (r'', include('mama_cas.urls')),

This makes the CAS server available at the top level of your project’s URL (e.g. To make the server available in a subdirectory, add the path to the regular expression. For example, to access the server at

urlpatterns = patterns('',
    # ...existing urls...
    (r'^cas/', include('mama_cas.urls')),


One or more authentication backends must be installed and configured based on your authoritative authentication sources. MamaCAS does not perform authentication itself, but relies on the active authentication backends. The process of installing and configuring authentication backends will change depending on the individual backend.