错误:django 1.3.1 中没有名为 staticfiles 的模块 +蟒蛇2.6?怎么了
我已经有几天没有在 django 项目上工作了,现在我回来了,但我无法继续工作。当我在 eclipse aptana 中调试或运行时,出现“错误:没有名为 staticfiles 的模块”错误。
- 我什至已经将 aptana 更新到今天的更新,但没有运气。
- 我已经卸载了django,删除所有文件并重新安装。
- 如果我在cmd(在Windows上)中使用python导入django,它就在我期望的位置
但是如果我从settings.py中删除“INSTALLED_APPS”中的“'django.contrib.staticfiles'”字符串,一切正常,但是正如预期的那样,我无法访问静态文件。
那时我已经安装了 Google 应用引擎 + python 2.5;这可能是问题所在以及如何解决?
非常感谢*
I didn't worked on the django project for somedays and now I return and I can't work on it. When I debug or run in eclipse aptana I get the "Error: No module named staticfiles" error.
- I have even updated aptana to today's updates and no luck.
- I have uninstalled the django, delete all files and reinstall.
- If I import django with python in cmd (on windows) it is in the place I expect to be
But if I delete the "'django.contrib.staticfiles'," string in the "INSTALLED_APPS" from settings.py everything works fine but I have no access to the static files, as expected..
In those days I have installed Google app engine + python 2.5; can this be the problem and how to solve?
thank you very much*
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是我找出问题所采取的步骤:
以下是我将来如何避免这种情况的方法:
[1] http:// pypi.python.org/pypi/virtualenv
[2] http://pypi.python.org /pypi/pip
注意 pip 和 easy_install 会自动安装到您的新 virtualenv 中
Here are the steps I'd take to find out the problem:
Here is how I would avoid this in future:
[1] http://pypi.python.org/pypi/virtualenv
[2] http://pypi.python.org/pypi/pip
NB pip and easy_install are automatically installed into your new virtualenv
使用
{% load static %}
而不是{% load staticfiles %}
在新版本的Django中,加载静态文件的语法发生了变化
use
{% load static %}
instead of{% load staticfiles %}
in the new version of Django, the syntax of loading static files changed