Django导入模块错误

时间:2013-04-29 15:02:11

标签: python django

我是Django的第一个,我有一个来自其他朋友的项目,当我要管理python runserver 0.0.0.0:8000时我有这个错误:

Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_manager(settings)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 457, in execute_manager
    setup_environ(settings_mod)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 433, in setup_environ
    import_module(project_name)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
ImportError: No module named Django_Project

我的python版本是Python 2.7.3

也许有人可以帮助我?谢谢!

2 个答案:

答案 0 :(得分:0)

As per the Django tutorial,执行runserver命令时必须更改为外部Django_Project目录。

答案 1 :(得分:0)

将项目Django添加到python路径,然后运行此命令。

要添加到python路径,请参阅以下链接Permanently add a directory to PYTHONPATH