Turning mapbox-gl-draw into a Django form field

I have seen Mapbox used in Django forms for recording points on a map. The example I have used is the mapbox-location-field widget: https://pypi.org/project/django-mapbox-location-field/

However, I haven't seen any use of Mapbox for recording polygon information. In my search for a solution I have come across the Mapbox-GL-Js documentation a lot. But, being inexperienced with JS, I don't know how to implement this into my Django app as a form field.

The end goal is to have a form comprised of a polygon input field and a few drop down fields which get POSTed to a PostgreSQL database.

Is it possible to turn mapbox-gl-draw into a form field that sits alongside other form inputs in a Django app?

Back to Top