推荐学习书目
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
peterkai
V2EX  ›  Python

django+uwsgi 访问 https url 的问题

  •  
  •   peterkai · May 12, 2015 · 2698 views
    This topic created in 4043 days ago, the information mentioned may be changed or developed.
    大家好,我现在用django+uwsgi+nginx搭建了一个网站。

    遇到了一个自认为比较奇葩的https url的访问问题

    我的django版本1.6, uwsgi版本2.0.4,python版本 2.7.3

    我在django shell里是可以正常访问https url的,如下所示:

    In [1]: import urllib2

    In [2]: response=urllib2.urlopen("https://www.baidu.com")

    In [3]: data=resposne.read()

    In [4]: data=response.read()

    In [5]: print data

    工作正常.

    但是如果我用uwsgi启动程序之后,使用相同的代码就会出现如下错误:

    urlopen error unknown url type: https

    完全搞不清楚原因了,请各位大神帮忙
    2 replies    2015-05-13 10:37:37 +08:00
    ericls
        1
    ericls  
       May 12, 2015
    所以这个跟 Django 和 uWSGI 有啥关系?
    你 uWSGI 启动的时候提示的 interpreter 和你 shell 用的 python interpreter 是一样的么?
    peterkai
        2
    peterkai  
    OP
       May 13, 2015
    应该是以前uwsgi编译方式有问题
    今天重新编译了uwsgi 问题搞定
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2928 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 06:37 · PVG 14:37 · LAX 23:37 · JFK 02:37
    ♥ Do have faith in what you're doing.