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

Django本地开发服务器奇慢是什么问题?

  •  
  •   spark · Dec 22, 2011 · 6686 views
    This topic created in 5281 days ago, the information mentioned may be changed or developed.
    什么都没有,全新开启一个项目:

    django-admin.py startproject test
    cd test
    python manage.py runserver

    之后在浏览器里要开30秒以上才能打开...

    Google到的解答基本是把/etc/hosts中 "::1 localhost" 注释掉,但对我无解。

    有问题的机器是Mac Pro,在mbp上反而跑的飞快,一点问题没有。

    同样我在这台机器开虚拟机的Ubuntu搭环境,也是跑的飞快,实在搞不懂。
    2 replies    1970-01-01 08:00:00 +08:00
    est
        1
    est  
       Dec 22, 2011
    strace之
    spark
        2
    spark  
    OP
       Jul 16, 2012
    在用Flask时也有同样的问题,终于在今天找到解决方案了。

    原因是我在Mac Pro没有设置DNS,而MBP是有的,然后我把前者设置了一个联通的DNS,问题迎刃而解。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2813 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 08:42 · PVG 16:42 · LAX 01:42 · JFK 04:42
    ♥ Do have faith in what you're doing.