0

Is there a kepler library i can install in my django project to use kepler.gl in my frontend, like in leaflet-django. If not, how do i use Kepler.gl maps as frontend for django backend?

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Oct 21 '21 at 11:28

2 Answers2

0

You can visit "kepler.gl/demo" and click in the left sidebar export to html. After that you can use this html for your endpoint (view template) in django.

The data can be passed trough the httpResponse in your views.py from the database to view into the script. If you like you can put the script code in seperate Javascript files and link them in your endpoint.

hsulso
  • 15
  • 5
0

You can use keplergl module in python. I think this will server your requirement. You can use "from keplergl import KeplerGl " to import it and use something like below code snippet.

from keplergl import KeplerGl 

map_1 = KeplerGl(height=600, config=custom_config)

// Add the data to the map
map_1.add_data(data=data, name="MAP NAME")
map_html =  map_1._repr_html_()

@router.get("/{path}")
async def index():
   return HTMLResponse(content=map_html, status_code=200)