Writing in HTML5 localStorage from a python / Flask application

I know that I need to use the JavaScript API in python to write to html5 localStorage, so I'm looking for the easiest way to do this.

My requirement is to share what is written to localStorage using the Flask REST API with ExtJS web interface.

Any suggestions would be greatly appreciated!

+4
source share
1 answer

All you have to do is add

<script></script> 

into your html file between which you can use the following code. Store the item in local storage with

localStorage.setItem('name', 'tom');

Restore it with

var name = localStorage.getItem('name');
+4
source

Source: https://habr.com/ru/post/1599745/


All Articles