- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我已经安装了 eclipse indigo 和 pydev 以及 python 32。
我已经配置了我的 python 路径并且可以创建一个“空的”django 项目:
但是,当我运行右键单击项目并运行 as->pydev: django
我得到:
Traceback (most recent call last):
File "C:\Users\djangoworkspace\test3\src\manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 443, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 69, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
__import__(name)
File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 8, in <module>
from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application
File "C:\Python27\lib\site-packages\django\core\servers\basehttp.py", line 26, in <module>
from django.views import static
File "C:\Python27\lib\site-packages\django\views\static.py", line 95, in <module>
template_translatable = ugettext_noop(u"Index of %(directory)s")
File "C:\Python27\lib\site-packages\django\utils\translation\__init__.py", line 75, in gettext_noop
return _trans.gettext_noop(message)
File "C:\Python27\lib\site-packages\django\utils\translation\__init__.py", line 48, in __getattr__
if settings.USE_I18N:
File "C:\Python27\lib\site-packages\django\utils\functional.py", line 184, in inner
self._setup()
File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 95, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'C:\Python27\Lib\site-packages\django\conf\project_template\settings.py' (Is it on sys.path?): Import by filename is not supported.
知道我需要修复什么才能在 Eclipse 中运行 Django 项目吗?
最佳答案
请务必按照 http://pydev.org/manual_adv_django.html 中的这些步骤进行操作
The project must be marked as a Django project inside of PyDev.
A DJANGO_MANAGE_LOCATION string substitution variable must point to the project-relative location of manage.py.
A DJANGO_SETTINGS_MODULE string substitution variable must contain the name of the settings module in that project.
DJANGO_SETTINGS_MODULE 实际上是 python 模块名,而不是具体的文件。所以你的 DJANGO_SETTINGS_MODULE 应该是 'project_template.settings'
关于python - 在eclipse中通过pydev集成django?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14014829/
使用 pydev 时,ctrl+f9 会打开一个方便的窗口,让我可以选择在当前文件中运行哪个单元测试。是否有相同功能的调试版本? 最佳答案 按 Ctrl + F9 启动单元测试。在下一个允许您选择测试
我一直在寻找一种在 eclipse 中使用 python 虚拟环境的好方法。 我发现的唯一建议是为每个虚拟环境创建一个新的 eclipse 范围的“解释器”。这对许多项目来说很麻烦,但它有效。 我希望
我在 Python 项目中所有模块的开头使用以下内容: import setup_loggers setup_loggers是一个可以做到这一点的模块。 import语句确保无论首先加载哪个模块,记录
我已经找了很长一段时间了,但就是找不到答案。类似的问题涉及第三方库等的一些棘手案例,但我的情况似乎很简单。不过我不明白这是如何工作的。 我使用的是 Eclipse 3.5.2、Pydev 2.2.0,
我已经通过easy_install安装了pylint。我可以跑 pylint 成功。但是 pydev 拒绝使用它。 我检查了“使用 pylint” 我配置了正确的路径 我在 eclipse 中更新了我
使用普通交互式控制台时,我让 ipython 在 pydev 中工作,但是当进入 Debug模式时,控制台恢复到标准 pydev 控制台。如果我关闭此控制台并重新打开它,ipython 会返回并且我可
随着 googleappengine 的启动创建了一个 gae 项目,并使用 textmate 对其进行了构建。 现在,我想将其导入到 Eclipse PyDev GAE 项目中。尝试导入它,但不起作
我经常使用错误的 PYTHONPATH 创建一个 Pydev(比如 Google App Engine)Eclipse 项目。比如说,它缺少“lib”。该项目充满了红色x的含义错误。很好。我将项目 P
在项目资源管理器中删除 PyDev 项目中的源文件夹时,项目 PYTHONPATH 未更新,并且大纲中有一个红色的 x 标记,并显示一条错误消息“源文件夹:[源文件夹名称]未找到”。 这真的是预期的行
所以我刚刚安装了 SubnetTree ( http://www.icir.org/robin/pysubnettree/ ),如果我打开 Python 交互式解释器,我可以成功导入它,而不会出现任何
我建立了一个新项目,并用简单的模型填充了它。 (基本上我在关注 tut 。) 当我在命令行上运行 python manage.py shell 时,它工作正常: >python manage.py s
如果您在 PyDev Package Explorer 中单击类似向下三角形的图标,然后选择“自定义 View ”,则“可用自定义”弹出菜单允许用户选择一组标准文件中的哪些是可见的在包资源管理器中。
在使用 PyDev zip 文件时,我很难让 Eclipse 识别 PyDev。 (我需要使用 zip 文件,因为开发机器无法访问互联网)。 我安装了 Eclipse 并下载了 PyDev zip。我
PyDev Eclipse 中的“源文件夹”和“pydev 包”有什么区别? 最佳答案 包是具有逻辑分组的文件的收集器 import . 源文件夹使文件可以直接导入 import 并且常规文件夹基本
在 Eclipse 中,您可以单击一个 Python 类变量,一旦它突出显示,右键单击以获取上下文菜单,然后运行“Refactoring->Generate Properties”。然后 PyDev
请提出一种使用pydev自动代码格式自动格式化eclipse项目中所有py文件的方法。我们正在使用pydev代码格式化程序来使我们的代码保持一致,并且确实希望将所有文件标准化。 由于我们已经在pyde
我在使用 PyDev 和 Eclipse 时遇到问题。这首先发生在我拥有的一些旧 EasyEclipse 版本上。我认为这只是因为 EasyEclipse 安装较旧,但现在 Eclipse 4.2.1
我一直在使用 PyDev 成功运行 nose 测试,并想试试 nose2。 所以我安装了它 pip install nose2 复制/粘贴来自 http://nose2.info/ 的示例代码进入名为
我昨天更新了 PyDev (Eclipse),现在它告诉我没有,姓名 和其他保留字/内置函数无效,但脚本运行得很好。我在这个论坛上读到这个问题涉及错误地导入内置插件。我曾尝试更改解释器并重新添加它,但
我无法让 Jython 控制台在 Eclipse Luna 中工作。 Python 控制台有效。 错误信息是: Error initializing console. Unexpected error
我是一名优秀的程序员,十分优秀!