Django API Reference¶
yoromaps.django¶
Django integration package. Add "yoromaps.django" to INSTALLED_APPS.
yoromaps.django
¶
Yoro Maps Django integration.
Add to your settings::
import yoromaps
INSTALLED_APPS = [..., "yoromaps.django"]
DATABASES = {
"default": { ... },
"maps": yoromaps.db_config("/path/to/country.yoromaps"),
}
yoromaps.django.views¶
Django views for tile serving and routing.
yoromaps.django.views
¶
Django views for yoro-maps — tile serving, routing, and POI API.
tile_view(request, z, x, y)
¶
Serve a map tile from the .yoromaps database.
GET /maps/tiles/{z}/{x}/{y}.png
Source code in src/yoromaps/django/views.py
route_view(request)
¶
Calculate a route between Yoro codes.
GET /maps/route/?codes=ML-ABC,ML-XYZ
Source code in src/yoromaps/django/views.py
pois_view(request)
¶
Query points of interest.
GET /maps/pois/?cell=CI-4H7A3B — POIs inside a Yoro cell
GET /maps/pois/?lat=6.8&lon=-5.3&radius=2000 — POIs within a radius (m)
GET /maps/pois/?q=marche&category=market — search by name/category
Source code in src/yoromaps/django/views.py
close_connection()
¶
Close this thread's cached read connection, if it holds one.
A server keeps the connection for the life of the thread on purpose — not reopening SQLite on every request is the whole point of the cache. Anything shorter-lived than a server, a test or a management command or a worker winding down, should call this: otherwise the connection is only released when the interpreter collects it, which Python 3.13 reports as an unclosed database rather than ignoring.
Source code in src/yoromaps/django/views.py
yoromaps.django.urls¶
URL configuration. Include with:
Registered URL patterns¶
| Pattern | Name | View |
|---|---|---|
tiles/<int:z>/<int:x>/<int:y>.png |
tile |
tile_view |
route/ |
route |
route_view |