我有一个中等大小的网站,但它需要大约30秒的PyCharm启动运行服务器,并准备运行应用程序。如果我“运行”应用程序,而不是“调试”,它将只需要大约3秒的启动。
我能做的一些事情加快了代码的更改和调试周期。我正在使用一个像样的MBP与16 of的RAM。所以硬件不是问题。
我已经从项目中排除了/media文件。我没有任何其他大量的文件会导致索引问题,我正在使用Postgres和Mongo。我正在运行Django 1.7 +十几个包,如:
dj-static==0.0.6
django-annoying==0.8.1
django-appconf==1.0.1
django-bootstrap-form==3.2
django-bootstrap-pagination==1.5.1
django-compressor==1.5
django-extensions==1.5.5
django-filter==0.10.0
django-guardian==1.2.5
django-storages-redux==1.2.3
django-widget-tweaks==1.3
djangorestframework==3.1.2
django-jinja==1.4.1
这是调试输出:
/Users/user1/.virtualenvs/env-test/bin/python "/Applications/PyCharm 4.5 EAP.app/Contents/helpers/pydev/pydevd.py" --multiproc --save-signatures --client 127.0.0.1 --port 64097 --file /Users/user1/gitroot/website1/manage.py runserver 0.0.0.0:8000 --verbosity 2
Connected to pydev debugger (build 141.1245)
pydev debugger: process 63926 is connecting
pydev debugger: process 63954 is connecting
Performing system checks...
System check identified no issues (0 silenced).
You have unapplied migrations; your app may not work properly until they are applied.
Run 'python manage.py migrate' to apply them.
June 03, 2015 - 09:08:52
Django version 1.7.7, using settings 'myproject.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
更新:,因为这篇文章,Pycharm能够使用Cython作为解释器。我认为这在一定程度上改善了情况。我还开始使用Runserverplus,我认为它运行得更快。
发布于 2016-08-23 13:55:11
我注意到原始海报的调试输出不包括有关cython的消息。我之所以来这篇文章,是因为我不明白为什么我的py魅力调试如此缓慢,但后来我意识到,关于加快调试器的建议就在我的调试输出中。
"<some-path-to-python>/python" "/Applications/PyCharm.app/Contents/helpers/pydev/setup_cython.py" build_ext --inplace
我希望大家都试过了。我想这个答案是给世界上没有输出的读者的。
https://stackoverflow.com/questions/30625587
复制相似问题