同步操作将从 Gitee 极速下载/lark 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Lark is a python library that provides a generic method from transforming a HTTP request into a redis command. If you have heard of webdis this works in roughly the same way. It provides two main framework specific methods for Django, and Flask. Though it should be easy to fit Lark into any python web framework.
To get started make sure that you have redis installed, then install lark.
pip install lark
Next you can create a simple Flask app that mounts the lark blueprint. Lark also comes with a Redis middleware for setting up redis connections.
from flask import Flask from lark.ext.flask.redis_api import redis_api_blueprint from lark.ext.flask.flask_redis import Redis app = Flask(__name__) # Add a simple redis connection to the global object Redis(app) app.config['DEFAULT_LARK_SCOPES'] = set(['admin']) # Mount the redis blueprint app.register_blueprint(redis_api_blueprint, url_prefix='/api/0') if __name__ == '__main__': app.run()
Now you can run the server and then you will be able to interact with the API like so. You can find documentation on all the calls here.
>>> curl http://127.0.0.1:5000/api/0/get/a/ {"meta": {"status": "ok", "status_code": 200} >>> curl -X POST -H 'Content-Type: application/json' \ --data-ascii '{"value": "foo"}' \ http://127.0.0.1:5000/api/0/set/a/ "meta": {"status": "ok", "status_code": 200}, "data": true} >>> curl http://127.0.0.1:5000/api/0/get/a/ {"meta": {"status": "ok", "status_code": 200}, "data": "foo"}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。