'Django Admin OSMWidget not displaying map

We use the Django Admin to set easily a Point. It is easier to navigate through a map rather than write latitude and longitude manually.

At the beginning of the project (5 months ago), the map displayed using the OSMWidget was perfectly displayed (I use this widget as the default one was displaying a terrain map and I want to display cities).

Three weeks ago, I logged in at the Admin page and I saw that the map was crashing. I am not aware of any update in my project, requirements.txt or anything but the map suddenly does not work.

enter image description here Here is how I see the map.

And here you can see what happen with network when I load the page: enter image description here enter image description here enter image description here

It seems something related with OpenStreetMaps but idk how to solve it, as when debugging the server, it does not display any error.

Here the admin code:

from django.contrib.gis import admin
from django.contrib.gis.db import models
from django.contrib.gis.forms.widgets import OSMWidget


class RestaurantAdmin(admin.OSMGeoAdmin):

    formfield_overrides = {
        models.PointField: {'widget': OSMWidget},
    }

    fieldsets = [
        ('Location', {'fields': [
            ('address', 'city', 'postal_code', 'country'),
            'coordinates'
        ]}),
    ]

Does anyone know how to fix it or if can I use another type of map?

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source