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
python30
V2EX  ›  Python

python2.7 的代码 改成了 python3.0 第一次运行报这错。然后就不提示了。。。

  •  
  •   python30 · 2020-03-21 15:49:53 +08:00 · 2051 次点击
    这是一个创建于 1502 天前的主题,其中的信息可能已经有所发展或是发生改变。

    python2.7 + django1.11 改成 python3 + django2.2 不知道哪里改的不彻底

    第一次在本机运行 python manage.py runserver 的时候出现下面提示, 很卡。 然后自已消息了。有时候也莫名其妙的又出现了。。。

    3 条回复    2020-03-22 22:50:15 +08:00
    wellsc
        1
    wellsc  
       2020-03-21 16:19:04 +08:00
    报错信息已经给你错误的位置了,simple_server.py 第 35 行的 split 方法有问题
    crella
        2
    crella  
       2020-03-21 16:39:42 +08:00
    报错的最后行是 python3\lib\wsgiref,这个应该是 py3 自带库的问题,换一个 django 版本和 python3 版本试试,除非比较有空,没必要死磕系统库。
    RyougiShiki
        3
    RyougiShiki  
       2020-03-22 22:50:15 +08:00
    用你现在的 py3 和 django2.2 新建一个简单项目,是否正常。
    django2.2 wsgi.py 相关代码比 1.11 有所变化。
    猜测老代码没改造完全。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   833 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:34 · PVG 06:34 · LAX 15:34 · JFK 18:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.