在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:sanic-org/sanic开源软件地址:https://github.com/sanic-org/sanic开源编程语言:Python 99.7%开源软件介绍:Sanic | Build fast. Run fast.
Sanic is a Python 3.7+ web server and web framework that's written to go fast. It allows the usage of the Sanic is also ASGI compliant, so you can deploy it with an alternative ASGI webserver. Source code on GitHub | Help and discussion board | User Guide | Chat on Discord The project is maintained by the community, for the community. Contributions are welcome! The goal of the project is to provide a simple way to get up and running a highly performant HTTP server that is easy to build, to expand, and ultimately to scale. SponsorCheck out open collective to learn more about helping to fund Sanic. Thanks to Linode for their contribution towards the development and community of Sanic. Installation
Note If you are running on a clean install of Fedora 28 or above, please make sure you have the Note Windows support is currently "experimental" and on a best-effort basis. Multiple workers are also not currently supported on Windows (see Issue #1517), but setting Hello World Examplefrom sanic import Sanic
from sanic.response import json
app = Sanic("my-hello-world-app")
@app.route('/')
async def test(request):
return json({'hello': 'world'})
if __name__ == '__main__':
app.run() Sanic can now be easily run using [2018-12-30 11:37:41 +0200] [13564] [INFO] Goin' Fast @ http://127.0.0.1:8000 [2018-12-30 11:37:41 +0200] [13564] [INFO] Starting worker [13564] And, we can verify it is working: HTTP/1.1 200 OK Connection: keep-alive Keep-Alive: 5 Content-Length: 17 Content-Type: application/json {"hello":"world"} Now, let's go build something fast! Minimum Python version is 3.7. If you need Python 3.6 support, please use v20.12LTS. DocumentationUser Guide and API Documentation. ChangelogQuestions and DiscussionAsk a question or join the conversation. ContributionWe are always happy to have new contributions. We have marked issues good for anyone looking to get started, and welcome questions on the forums. Please take a look at our Contribution guidelines. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论