V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
myyou
V2EX  ›  Python

python flask 报错求助!

  •  
  •   myyou · 2016-03-28 18:08:26 +08:00 · 3458 次点击
    这是一个创建于 3154 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Traceback (most recent call last):

    File "/obj1/wechat/env/local/lib/python2.7/site-packages/flask/app.py", line 1836, in call 
    
        return self.wsgi_app(environ, start_response)
        
    File "/obj1/wechat/env/local/lib/python2.7/site-packages/flask/app.py", line 1821, in wsgi_app 
    
        return response(environ, start_response)
        
    File "/obj1/wechat/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py", line 1200, in call 
    
        app_iter, status, headers = self.get_wsgi_response(environ) 
        
    File "/obj1/wechat/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py", line 1188, in get_wsgi_response 
    
        headers = self.get_wsgi_headers(environ) 
        
    File "/obj1/wechat/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py", line 1110, in get_wsgi_headers 
    
        current_url = get_current_url(environ, root_only=True) 
        
    File "/obj1/wechat/env/local/lib/python2.7/site-packages/werkzeug/wsgi.py", line 70, in get_current_url 
    
        tmp = [environ['wsgi.url_scheme'], '://', get_host(environ, trusted_hosts)] 
    

    KeyError: 'wsgi.url_scheme'

    请问这是什么问题引起的?

    1 条回复    2016-03-28 20:01:12 +08:00
    qq316107934
        1
    qq316107934  
       2016-03-28 20:01:12 +08:00
    response 格式不符合预期吧,解析的时候发现这个 key 不存在。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2222 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 74ms · UTC 00:39 · PVG 08:39 · LAX 16:39 · JFK 19:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.