我正在学习Django,我还在第一篇教程中。当我尝试跑步时:
python manage.py shell
我收到以下错误:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
338, in execute_from_command_line
utility.execute()
File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line
312, in execute
django.setup()
File "C:\Python27\lib\site-packages\django\__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Python27\lib\site-packages\django\apps\registry.py", line 108, in pop
ulate
app_config.import_models(all_models)
File "C:\Python27\lib\site-packages\django\apps\config.py", line 198, in impor
t_models
self.models_module = import_module(models_module_name)
File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
__import__(name)
File "C:\Users\Elashkar\Desktop\django\mysite\polls\models.py", line 2, in <mo
dule>
import datatime
ImportError: No module named datatime
答案 0 :(得分:2)
这看起来像是import语句中的拼写错误。 datatime
应为datetime
(a - &gt; e)。