Developer Installation Instructions
Note
This page is for developers who want to customize or extend OpenWISP Firmware Upgrader, whether for bug fixes, new features, or contributions.
For user guides and general information, please see:
Requirements
Python >= 3.8
Install Dependencies
Install spatialite and sqlite:
sudo apt-get install sqlite3 libsqlite3-dev openssl libssl-dev
sudo apt-get install gdal-bin libproj-dev libgeos-dev libspatialite-dev libsqlite3-mod-spatialite
Installing for Development
Fork and clone the forked repository:
git clone git://github.com/<your_fork>/openwisp-firmware-upgrader
Navigate into the cloned repository:
cd openwisp-firmware-upgrader/
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 prettier
Install WebDriver for Chromium for your browser version from
https://chromedriver.chromium.org/home and Extract chromedriver to one
of directories from your $PATH (example: ~/.local/bin/).
Create database:
cd tests/
./manage.py migrate
./manage.py createsuperuser
Launch development server:
./manage.py runserver 0.0.0.0:8000
You can access the admin interface at http://127.0.0.1:8000/admin/.
Run celery and celery-beat with the following commands (separate terminal windows are needed):
# (cd tests)
celery -A openwisp2 worker -l info
celery -A openwisp2 beat -l info
Run QA checks with:
./run-qa-checks
Run tests with (make sure you have the selenium dependencies installed locally first):
./runtests
./runtests is a wrapper that runs tests for both
openwisp_firmware_upgrader and the SAMPLE_APP. To run only the
SAMPLE_APP tests:
SAMPLE_APP=1 ./runtests.py --keepdb --failfast
Important
If you want to add openwisp-firmware-upgrader to an existing
Django project, then you can take reference from the test project in
openwisp-firmware-upgrader repository