Django newbie here: my aim is to integrate Folium to an html page. so what I have at the moment:
polls/views.py
def show_map(request
You can get the html as a string by triggering the rendering on the (internal) parent of Map
:
m = folium.Map()
html: str = m.get_root().render()
Note that this returns a full html page, so you may need to put it in an iframe.
Alternatively, you can render the head, body and script parts separately. That way you can put each part on your page where it belongs and you don't need an iframe:
m = folium.Map()
html_head: str = m.get_root().header.render()
html_body: str = m.get_root().html.render()
html_script: str = m.get_root().script.render()