Skip to main content

django-osm

https://badge.fury.io/py/django-osm.svg https://app.travis-ci.com/dcopm999/django-osm.svg?branch=master https://codecov.io/gh/dcopm999/django-osm/branch/master/graph/badge.svg

Project Open Street Map management

Documentation

The full documentation is at https://django-osm.readthedocs.io.

Quickstart

Install django-osm:

pip install django-osm

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    "django.contrib.gis",
    "django_celery_beat",
    "rest_framework",
    "rest_framework_gis",
    "osm",
    ...
)

DATABASE_ROUTERS = [
    ...
    'osm.route_db.Default'
]

DATABASES = {
    ...
    'osm': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'HOST': 'localhost',
        'NAME': 'geodjango',
    },
}
OSM_REPLICS = ['osm']

If there is OSM database replication, then add the connection parameters to us in the list of databases:

DATABASES = {
    ...
    'osm_replica1': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'HOST': 'localhost',
        'NAME': 'geodjango',
        },

}

And complete the list of replicas OSM_REPLICS:

OSM_REPLICS = ['osm', 'osm_replica1']

Add django-osm’s URL patterns:

urlpatterns = [
    ...
    path('osm/', include('osm.urls', namespace='osm')),
    ...
]

Add DRF settings:

 REST_FRAMEWORK = {
     "DEFAULT_AUTHENTICATION_CLASSES": (
         "rest_framework.authentication.SessionAuthentication",
         "rest_framework.authentication.TokenAuthentication",
     ),
     "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",),
     'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
     'PAGE_SIZE': 25
}

Features

  • TODO

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Development commands

pip install -r requirements_dev.txt
invoke -l

Credits

Tools used in rendering this package:

History

0.1.0 (2021-01-16)

  • First release on PyPI.

Release files for django-osm 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-osm 0.1.0
File Size Uploaded
django-osm-0.1.0.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-osm 0.1.0
File Interpreter ABI Platform
django_osm-0.1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 29.4 kB

Release files / django-osm-0.1.0.tar.gz

Download URL django-osm-0.1.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e95e9b2dbdc4174a3b89b284a02c67b57fef42b28450fb4383a2235a6b557f1e
BLAKE2b-256 checksum
How to use checksums
374a7db24f1817a0e740684dd31014161db9a5345b77096bcccc8db529d41b72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

Release files / django_osm-0.1.0-py2.py3-none-any.whl

Download URL django_osm-0.1.0-py2.py3-none-any.whl
Size 15.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
83449727f7e31c639517f2385a2d79969c152a2e429a40c56d9a7332c1a09012
BLAKE2b-256 checksum
How to use checksums
86f3c9d248ab24905e44fb129efbd37b98ea47ca9526f04f8a206f4a2e576f14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page