DryORM
Code
Result
no cache
Django 6.0
Django 5.2.8
Django 4.2.26 LTS
SQLAlchemy 2.0
Prisma 6.3
SQLite
PostgreSQL 17.4
PostGIS 3.5 (PostgreSQL 16)
MariaDB 11.4.5
Select a template
django
sqlalchemy
prisma
from django.template import Context from django.template import Template from django.contrib.gis.db import models as geomodels from django.contrib.gis.geos import Point import json class Place(geomodels.Model): name = geomodels.CharField(max_length=100) location = geomodels.PointField(geography=True, null=True, blank=True) def run(): Place.objects.all().delete() places = Place.objects.bulk_create([ Place(name='Beirut', location=Point(35.5018, 33.8938)), Place(name='Paris', location=Point(2.3522, 48.8566)), Place(name='London', location=Point(-0.1276, 51.5074)), ]) markers = [ {"name": p.name, "lat": p.location.y, "lng": p.location.x} for p in places ] markers_json = json.dumps(markers) html = Template(""" <!doctype html> <html> <head> <meta charset="utf-8"> <title>Full Height GeoDjango Map</title> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin="" /> <style> html, body { height: 100%; margin: 0; padding: 0; } #container { height: 100%; width: 100%; display: flex; flex-direction: column; } #map { flex: 1; width: 100%; } </style> </head> <body> <div id="container"> <div id="map"></div> </div> <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""> </script> <script> const markers = {{ markers_json|safe }}; if (markers.length === 0) { document.getElementById('map').innerHTML = 'No places to show.'; } else { const map = L.map('map').setView( [markers[0].lat, markers[0].lng], 4 ); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 19, attribution: '© OpenStreetMap contributors' }).addTo(map); markers.forEach(m => { L.marker([m.lat, m.lng]) .addTo(map) .bindPopup(m.name); }); } </script> </body> </html> """).render(Context({ "markers_json": markers_json })) print(html) return html
Output
Show Template
No output.
Queries
INSERT
I
UPDATE
U
SELECT
S
DELETE
D
DDL
D
TCL
T
Queries
Q
(
0
)
No queries.
✖ Close
Save & Share
✖
private?
Save
Save & Copy