当前位置:网站首页>Sanic服务启动失败
Sanic服务启动失败
2022-06-24 20:07:00 【七分辣度】
创建sanic服务启动失败:
#!/usr/bin/env python
# -*- coding: utf-8 -*
''' @Project :Sanic01 @File :main.py @Author :Aron @Date :2022/6/21 14:38 '''
from sanic import Sanic
from sanic.response import json,json_dumps
app = Sanic(name='hello-example') # name必须是字符串开头,只能包含数字字母、_、-
@app.get('/')
async def test(request):
return json({
'hello':'world'
})
if __name__ == '__main__':
app.run(host='0.0.0.0',port=8000)
Sanic启动服务时,终端显示:
"D:\Program File\Python\python.exe" "D:\Program File\PythoProfessional\PyCharm 2021.3\plugins\python\helpers\pycharm\_jb_pytest_runner.py" --target main.py::test
Testing started at 15:04 ...
Launching pytest with arguments main.py::test --no-header --no-summary -q in D:\Project\pythonProject\Sanic01\bin
============================= test session starts =============================
collecting ... collected 1 item
main.py::test SKIPPED (async def function and no async plugin instal...) [100%]
Skipped: async def function and no async plugin installed (see warnings)
======================== 1 skipped, 1 warning in 0.12s ========================
Process finished with exit code 0
由于,接口函数以test*
开头,被当成了测试用例,随便改个名字(eg. demo)即可正常启动!
"D:\Program File\Python\python.exe" D:/Project/pythonProject/Sanic01/bin/main.py
[2022-06-21 15:10:46 +0800] [18760] [INFO] Sanic v22.3.2
[2022-06-21 15:10:46 +0800] [18760] [INFO] Goin' Fast @ http://0.0.0.0:8000
[2022-06-21 15:10:46 +0800] [18760] [INFO] mode: production, single worker
[2022-06-21 15:10:46 +0800] [18760] [INFO] server: sanic
[2022-06-21 15:10:46 +0800] [18760] [INFO] python: 3.9.0
[2022-06-21 15:10:46 +0800] [18760] [INFO] platform: Windows-10-10.0.19041-SP0
[2022-06-21 15:10:46 +0800] [18760] [INFO] packages: sanic-routing==22.3.0
[2022-06-21 15:10:46 +0800] [18760] [INFO] Starting worker [18760]
边栏推荐
- Discrete mathematics and its application detailed explanation of exercises in the final exam of spring and summer semester of 2018-2019 academic year
- How to reduce the font size of custom controls (optimize the round dot progress bar)
- The basic principle and application of iterator and enhanced for
- Usage of ViewModel and livedata in jetpack
- C#和C 的CAN通信实验
- 【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
- Activity startup process
- VNC viewer remote connection raspberry pie without display
- Meta&伯克利基于池化自注意力机制提出通用多尺度视觉Transformer,在ImageNet分类准确率达88.8%!开源...
- 2021-11-07
猜你喜欢
Design and practice of vivo server monitoring architecture
Tiktok wallpaper applet, starlight wallpaper applet version 2.0, upgraded version
移动安全工具-jar
Source code analysis the problem that fragments cannot be displayed in the custom ViewGroup
Meta & Berkeley proposed a universal multi-scale visual transformer based on pooled self attention mechanism. The classification accuracy in Imagenet reached 88.8%! Open source
Paper review: U2 net, u-net composed of u-net
Unimportant tokens can be stopped in advance! NVIDIA proposes an efficient visual transformer network a-vit with adaptive token to improve the throughput of the model
In the process of enterprise development, I found that a colleague used the select * from where condition for update
Binder mechanism and Aidl communication example
Using tcp/udp tools to debug the yeelight ribbon
随机推荐
Easy to wear - drop down radio
Databinding quick start (still using findviewbyid?)
2021-11-05
ServerSocket and socket connection
Single blind box removal, social blind box and friend blind box program source code
What is test development? Can you find a job at this stage?
[redis realizes seckill service ④] one order for one person, and cannot be purchased repeatedly
A plug-in framework for implementing registration free and login verification with hook technology
Custom animation (simulated win10 loading animation)
传输层 以字节为单位的滑动窗口技术
WordPress add photo album function [advanced custom fields Pro custom fields plug-in series tutorial]
【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
Encryption and encoding resolution
C# Winform 最大化遮挡任务栏和全屏显示问题
Meta&伯克利基于池化自注意力机制提出通用多尺度视觉Transformer,在ImageNet分类准确率达88.8%!开源...
Fuxin Kunpeng joins in, and dragon lizard community welcomes a new partner in format document technical service
Garbage collection of C closure
ros(25):rqt_ image_ View reports an error unable to load plugin for transport 'compressed', error string
[Solved] Public key for mysql-community-xxx. rpm is not installed
The drawableleft of the custom textview in kotlin is displayed in the center together with the text