运行Django开发服务器

时间:2011-07-26 07:23:33

标签: python django

我正在尝试创建并运行一个项目。

我使用了以下文章:

https://docs.djangoproject.com/en/dev/intro/tutorial01/?from=olddocs

当我运行以下命令时

C:\django\mysite>python manage.py runserver

此错误显示:

Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_manager(settings)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 438, in execute_manager
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 379, 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 67, 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\contrib\staticfiles\management\commands\runserver.py", line 4, in <module>
    from django.core.management.commands.runserver import BaseRunserverCommand
  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 8, in <module>
    from django.core.handlers.wsgi import WSGIHandler
  File "C:\Python27\lib\site-packages\django\core\handlers\wsgi.py", line 10, in <module>
    from django import http
  File "C:\Python27\lib\site-packages\django\http\__init__.py", line 117, in <module>
    from django.core import signing
ImportError: cannot import name signing

1 个答案:

答案 0 :(得分:1)

这是我要做的。 尝试使用virtualenv。 可能有一些旧的python模块由于某种原因弄乱了你的django。 所以使用virtualenv来创建一个新的python。 并使用pip install安装django。 如果它解决了问题,那么你的系统python就会把它弄得一团糟。