Installation

Prerequisites

The primary prerequisite of MamaCAS is Django itself. MamaCAS works with supported versions of Django as well as Long-term support (LTS) releases. Other versions of Django may work, but are not officially tested or supported. See the Django downloads page for download and installation details.

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

Installing

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 setup.py install

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

$ git clone git://github.com/jbittel/django-mama-cas.git

Configuring

Add MamaCAS to the INSTALLED_APPS setting within your project’s settings.py (or equivalent) file:

INSTALLED_APPS = (
    # ...existing apps...
    'mama_cas',
)

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

URL paths

Include the required CAS URL endpoints 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. http://example.com/login). To add a subpath to the CAS root (e.g. http://example.com/cas/login) add the path to the URL regular expression:

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

Authenticating

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.