Developer Installation Instructions

Note

This page is for developers who want to customize or extend OpenWISP Notifications, whether for bug fixes, new features, or contributions.

For user guides and general information, please see:

Installing for Development

Install the system dependencies:

sudo apt install sqlite3 libsqlite3-dev openssl libssl-dev

Fork and clone the forked repository:

git clone git://github.com/<your_fork>/openwisp-notifications

Navigate into the cloned repository:

cd openwisp-notifications/

Launch Redis:

docker-compose up -d redis

Setup and activate a virtual-environment (we'll be using virtualenv):

python -m virtualenv env
source env/bin/activate

Make sure that your base python packages are up to date before moving to the next step:

pip install -U pip wheel setuptools

Install development dependencies:

pip install -e .
pip install -r requirements-test.txt
sudo npm install -g jshint stylelint

Create database:

cd tests/
./manage.py migrate
./manage.py createsuperuser

Launch celery worker (for background jobs):

celery -A openwisp2 worker -l info

Launch development server:

./manage.py runserver

You can access the admin interface at http://127.0.0.1:8000/admin/.

Run tests with:

# standard tests
./runtests.py

# If you running tests on PROD environment
./runtests.py --exclude skip_prod

# tests for the sample app
SAMPLE_APP=1 ./runtests.py

When running the last line of the previous example, the environment variable SAMPLE_APP activates the sample app in /tests/openwisp2/ which is a simple django app that extends openwisp-notifications with the sole purpose of testing its extensibility, for more information regarding this concept, read the following section.

Run quality assurance tests with:

./run-qa-checks

Alternative Sources

Pypi

To install the latest Pypi:

pip install openwisp-notifications

Github

To install the latest development version tarball via HTTPs:

pip install https://github.com/openwisp/openwisp-notifications/tarball/master

Alternatively you can use the git protocol:

pip install -e git+git://github.com/openwisp/openwisp-notifications#egg=openwisp_notifications