推荐学习书目
› 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 · Mar 28, 2016 · 4021 views
    This topic created in 3839 days ago, the information mentioned may be changed or developed.

    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 replies  •  2016-03-28 20:01:12 +08:00
    qq316107934
        1
    qq316107934  
       Mar 28, 2016
    response 格式不符合预期吧,解析的时候发现这个 key 不存在。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2296 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 05:56 · PVG 13:56 · LAX 22:56 · JFK 01:56
    ♥ Do have faith in what you're doing.