Skip to main content

Legacy features of OpenWISP Manager reimplemented in django

Project description

CI build status Test Coverage Dependency monitoring Chat https://badge.fury.io/py/django-owm-legacy.svg Downloads code style: black

Legacy features of OpenWISP Manager reimplemented in django for OpenWISP2.

Install stable version from pypi

Install from pypi:

pip install django-owm-legacy

Install development version

Install tarball:

pip install https://github.com/openwisp/django-owm-legacy/tarball/master

Alternatively you can install via pip using git:

pip install -e git+git://github.com/openwisp/django-owm-legacy#egg=django-owm-legacy

If you want to contribute, install your cloned fork:

git clone git@github.com:<your_fork>/django-owm-legacy.git
cd django-owm-legacy
python setup.py develop

Setup (integrate in an existing django project)

Add openwisp_controller and owm_legacy to INSTALLED_APPS as follow:

INSTALLED_APPS = [
    # ...
    "django.contrib.sites",
    # allauth
    "allauth",
    "allauth.account",
    "django_extensions",
    # openwisp2 modules
    "openwisp_controller.config",
    "openwisp_controller.pki",
    "openwisp_controller.geo",
    "openwisp_controller.connection",
    "openwisp_users",
    "openwisp_notifications",
    "openwisp_ipam",
    # openwisp2 admin theme
    # (must be loaded here)
    "openwisp_utils.admin_theme",
    "django.contrib.admin",
    "django.forms",
    # other dependencies
    "sortedm2m",
    "reversion",
    "leaflet",
    "flat_json_widget",
    "owm_legacy",
    # ...
]

Other settings needed in settings.py:

EXTENDED_APPS = ("django_x509", "django_loci")

AUTH_USER_MODEL = "openwisp_users.User"
SITE_ID = 1

Your urls.py should look like the following:

from django.urls import include, path
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

admin.autodiscover()


urlpatterns = [
    path("admin/", include(admin.site.urls)),
    path("", include("openwisp_controller.urls", namespace="controller")),
    path("", include("owm_legacy.urls", namespace="owm_legacy")),
]

urlpatterns += staticfiles_urlpatterns()

Installing for development

Install sqlite:

sudo apt install -y sqlite3 libsqlite3-dev openssl libssl-dev
sudo apt install -y gdal-bin libproj-dev libgeos-dev libspatialite-dev libsqlite3-mod-spatialite

Launch Redis:

docker-compose up -d redis

Install your forked repo:

git clone git://github.com/<your_fork>/django-owm-legacy
cd django-owm-legacy/
python setup.py develop

Install test requirements:

pip install -r requirements-test.txt

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:

./runtests.py

Settings

OWM_LEGACY_ALLOWED_SUBNETS

type:

list

default:

['10.8.0.0/16', '127.0.0.1/32']

List of strings representing ip networks allowed to retrieve checksums and download configuration archives.

Contributing

Please refer to the OpenWISP contributing guidelines.

Changelog

See CHANGES.

License

See LICENSE.

Support

See OpenWISP Support Channels.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_owm_legacy-1.1.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_owm_legacy-1.1-py2.py3-none-any.whl (19.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_owm_legacy-1.1.tar.gz.

File metadata

  • Download URL: django_owm_legacy-1.1.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for django_owm_legacy-1.1.tar.gz
Algorithm Hash digest
SHA256 dfc017ca92d463632dd8bbd9034f6624fba5aa56c42c99c23ac5984389d62307
MD5 5161e75e2851c9a1f8936acc07f37ca8
BLAKE2b-256 9a9b5f5be461734b24413bf89e2252a582a54eefa66c0f6b8c8daf4c7e921999

See more details on using hashes here.

File details

Details for the file django_owm_legacy-1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_owm_legacy-1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 38686c9be932b4e9bd9606b878c1cdb75365eb35ce4a87368cfe6512b7882a79
MD5 8ffc98c0f365431b606cc390a335603a
BLAKE2b-256 07f0bf4d3b4c888cda15c2e11e3057a10e0e579452f7b65ca65202709c84333d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page