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

django安装后runserver成功但本地打不开127.0.0.1:8000?

  •  
  •   laiqs2011 · Aug 18, 2013 · 8859 views
    This topic created in 4825 days ago, the information mentioned may be changed or developed.
    windows系统,装的是python33和django1.5.2,装完后试图打开自带的服务器,失败了。
    最后一行显示错误:Error:'utf-8' codec can't decode byte 0xc0 in position 2: invalid start byte
    且浏览器打不开127.0.0.1:8000,安装路径没有中文,也没有打开py文件来另存过,都是按着官方教程来安装的,怎么破这个问题?
    今天刚开始学python,无基础。
    8 replies  •  1970-01-01 08:00:00 +08:00
    sandtears
    sandtears
    Aug 18, 2013❤️1
    1
    开头加一行
    # coding: utf-8
    laiqs2011
    laiqs2011
    OP
    Aug 18, 2013
    2
    @sandtears 我都没动过py文件。

    都是官方下载的文件,装完python后装django,然后新建project,没对这些文件做任何修改。

    - - 不会是win8.1的系统问题吧?
    laiqs2011
    laiqs2011
    OP
    Aug 18, 2013
    3
    - - 好吧,一个前辈刚新用他电脑操作了一遍,没有出现错误,那就是我电脑自身的问题了。

    之前装的是WIN7,然后为了体验win8.1就装了双系统,python相同目录下还有装了XAMPP

    - - 没linux基础,学python要在linux环境下才会爽么?
    laiqs2011
    laiqs2011
    OP
    Aug 18, 2013
    4
    已解决这个问题。
    继续查阅资料后发现是python2.x与python3.x有很大的不同,我担心是兼容上除了问题。
    于是再安装了一个python2.7版,新建项目,成功!
    sandtears
    sandtears
    Aug 19, 2013❤️1
    5
    @laiqs2011 那应该是python3的问题了。的确Django对python3支持不好,官方也是推荐用2.7版
    laiqs2011
    laiqs2011
    OP
    Aug 19, 2013
    6
    @sandtears 就是改用了2.7 可以用了。谢谢!
    garth
    garth
    Aug 20, 2013 via Android❤️1
    7
    同样是windows系统,装的也是python33和django1.5.2,搭建很顺利啊。
    cloudream
    cloudream
    Aug 24, 2013❤️1
    8
    直接上1.6beta2,对python 3的支持更好。1.6分支已经非常稳定了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3827 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 05:34 · PVG 13:34 · LAX 21:34 · JFK 00:34
    ♥ Do have faith in what you're doing.