edx-django-sites-extensions

Extensions to the Django “sites” framework.

Getting Started

Install this package in your python environment:

$ pip install edx-django-sites-extensions

Add django.contrib.sites.middleware.CurrentSiteMiddleware to your MIDDLEWARE_CLASSES list.

Set the SITE_ID setting:

SITE_ID = 1

Set up RedirectMiddleware

Add django_sites_extensions.middleware.RedirectMiddleware to your MIDDLEWARE_CLASSES list.

You can then use Django admin to create Redirect models.

Testing

If you have not already done so, create/activate a virtualenv. Unless otherwise stated, assume all terminal code below is executed within the virtualenv.

Install dependencies

Dependencies can be installed via the command below.

$ make requirements

Run tests

The command below runs the Python tests and code quality validation—Pylint and PEP8.

$ make test

Code quality validation can be run independently with:

$ make quality