我正在使用Annotatorjs 库,我想将它与Annotator-Store 插件结合起来在 Python Flask 服务器上运行它。
但我不知道如何将数据从 Javascript 发送到 Python 并在那里接收,以便我可以将带注释的数据存储在数据库中。
我的 Javascript 代码如下所示:
//load tag plugin
content.annotator('addPlugin', 'Tags');
//load store plugin for save and retrieve annotations
content.annotator('addPlugin', 'Store', {
// The endpoint of the store on your server.
prefix: 'http://localhost/annotations',
// Attach the uri of the current page to all annotations to allow search.
annotationData: {
'uri': 'http://localhost/'
},
urls: {
// These are the default URLs.
create: '/annotations',
update: '/annotations/:id',
destroy: '/annotations/:id',
search: '/search'
}
// This will perform a "search" action when the plugin loads. Will
// request the last 20 annotations for the current url.
// eg. /store/endpoint/search?limit=20&uri=http://this/document/only
loadFromSearch: {
'limit': 100,
'all_fields': 1,
'uri': 'http://localhost/'
},
showViewPermissionsCheckbox: false,
showEditPermissionsCheckbox: false
});
});
但是我怎样才能在我的 Python 文件中接收数据呢?