Edx-enterprise
is a pluggable Django application designed to be run within edx-platform. It is shipped with any
edx-platform install, but can be disabled or even removed from a particular Open edX instance.
General direction is to decouple edx-enterprise
from the rest of the edx-platform as much as possible, since
the overall goal is to eventually make it an independent application or a plugin for a separate admin site, and not be
part of the edx-platform LMS.
In order to maintain the separation of edx-enterprise from the edx-platform, follow these practices:
edx-platform features
, use REST APIs rather than Python APIs.edx-enterprise
side, to simplify future migration to a REST API.Other noteworthy points:
edx-enterprise
does not interact with Studio.edx-enterprise
supports multiple python and Django versions:pycodestyle
, pylint
, isort
, jshint
, etc.).Although edx-enterprise
can’t be used outside edx-platform, some development process steps are intended to be
performed in a standalone virtual environment.
If you have not already done so, create/activate a virtualenv. Unless otherwise stated, assume all terminal code below is executed within the virtualenv.
This application uses tox to run tests under multiple Python and Django version. In addition, the following test utilities are used:
The edx-enterprise Makefile provides multiple shortcuts to running tests. The most noteable are:
$ make test # run all tests in current virtualenv
$ make diff_cover # run all tests in current virtualenv and report diff coverage
# run quality checks, all tests in every supported env (Python and Django versions) and jasmine JS tests
$ make test-all
More info about running tests is available in Testing section.
A whole bunch of static analyzers are used to ensure code quality. Most notable are pycodestyle
(formerly pep8
),
pylint
and jshint
.
$ make quality # runs all python and docs quality check
$ tox -e quality # same
$ make jshint # runs jshint on files in enterprise folder
This documentation is generated by Sphinx. Essentially, there are two parts of documentation - manually written
(located in docs
folder) and generated from docstrings.
$ tox -e docs # performs docs quality check and generates docs in HTML
$ make docs # same, but also opens browser at the index page
See Internationalization chapter for details.
If you’re migrating from an older version (i.e. pre Nov 2016) of edx-platform, you might need to ensure edx-enterprise is installed correctly. Three things need to happen:
edx-enterprise
must be installed in edxapp env.edx-enterprise
must be added to INSTALLED_APPS
.All three should happen automatically if you use paver commands to upgrade your setup, but just in case something goes wrong with the setup, here are instructions to manually perform the upgrade.
First, install edx-enterprise
into virtualenv. In edxapp
virtualenv ($current_release
is 0.31.2)[1]
$ cd /edx/app/edxapp/edx-platform
$ pip install edx-enterprise==$current_release
Than, make sure edx-enterprise
is included in INSTALLED_APPS
or OPTIONAL_APPS
(see lms/env/common.py
as an example) and run migrations:
$ paver update_db
# Or use a more down-to-the-root command (replace aws with your version of config)
$ ./manage.py lms migrate --settings=devstack
Footnotes
[1] | Due to limitations of Sphinx formatting, it is impossible to inject current version into code block while retaining formatting. |