因此,我正在使用venv在windows 10上学习Falcon教程。
falcon==1.4.1
waitress==1.1.0
用户指南进行得很好,但它得到了以下服务:
httpd = simple_server.make_server('127.0.0.1', 8000, app)
httpd.serve_forever()
本教程目前处理两个文件:
resource.py
import json
import falcon
class Resource(object):
def on_get(self, req, resp):
doc = {
'images': [
{
'href': '/images/1eaf6ef1-7f2d-4ecc-a8d5-6e8adba7cc0e.png'
}
]
}
resp.body = json.dumps(doc, ensure_ascii=False)
resp.status = falcon.HTTP_200
app.py
import falcon
from .images import Resource
api = application = falcon.API()
images = Resource()
api.add_route('/images', images)
女服务员开始使用
waitress-serve --port=8000 look:app
用提出请求
http localhost:8000/images
错误响应
错误:服务员:服务于"c:\users\ivan\dev\py\projects\falcon\look.venv\lib\site-packages\waitress\channel.py",跟踪(最近一次调用)时的异常:文件/images行338,在服务task.service()文件task.service第169行中,在service self.execute() File self.execute第399行中,执行app_iter = self.channel.server.application(env,start_response) TypeError:“模块”对象不可调用
有什么想法/投入如何克服这一问题?
发布于 2018-07-27 17:47:38
https://stackoverflow.com/questions/51562967
复制相似问题