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

Replace django.contrib.sites.middleware.CurrentSiteMiddleware with django_sites_extensions.middleware.CurrentSiteWithDefaultMiddleware.

Add default site setting to Django settings:

DEFAULT_SITE_ID = 1

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 validate

Code quality validation can be run independently with:

$ make quality