Opened 95 minutes ago

Last modified 93 minutes ago

#36990 new Bug

Referrer header required for django.contrib.gis.forms.widgets.OSMWidget

Reported by: diestl Owned by:
Component: GIS Version: 6.0
Severity: Normal Keywords:
Cc: diestl Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The OSMWidget does not set the referrer header (or does not configure open layers to set the referrer header) when making tile requests to the OSM tile server. As per the OSM tile usage policy (https://operations.osmfoundation.org/policies/tiles/), these requests are being blocked.

The OSMWidget is the default widget used in the django admin interface when using the django.contrib.gis.admin.options.GISModelAdmin admin base class for geometry fields such as django.contrib.gis.db.models.PolygonField.

To reproduce this, you need a very simple model:

from django.contrib.gis.db import models


class TmpModel(models.Model):
    geometry = models.PolygonField(geography=True)

and admin:

from .models import TmpModel
from django.contrib.gis import admin


@admin.register(TmpModel)
class DatasetAdmin(admin.GISModelAdmin):
    pass

Attachments (1)

permission_denied_osm_scaled.png (102.6 KB ) - added by diestl 91 minutes ago.
Screenshot illustrating the issue in the admin interface

Download all attachments as: .zip

Change History (2)

comment:1 by diestl, 93 minutes ago

Cc: diestl added

by diestl, 91 minutes ago

Screenshot illustrating the issue in the admin interface

Note: See TracTickets for help on using tickets.
Back to Top