编程一枝花
2021-07-12 11:38
采纳率: 100%
浏览 144

运行py manage.py shell命令时出现错误

D:\mysite> py manage.py shell
Traceback (most recent call last):
File "manage.py", line 22, in
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "C:\python\lib\site-packages\django\core\management_init.py", line 419, in execute_from_command_line
utility.execute()
File "C:\python\lib\site-packages\django\core\management_init
.py", line 395, in execute
django.setup()
File "C:\python\lib\site-packages\django_init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\python\lib\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "C:\python\lib\site-packages\django\apps\config.py", line 301, in import_models
self.models_module = import_module(models_module_name)
File "C:\python\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 724, in exec_module
File "", line 860, in get_code
File "", line 791, in source_to_code
File "", line 219, in _call_with_frames_removed
File "D:\mysite\polls\models.py", line 22
def str(self):
^
IndentationError: unexpected indent
如果是创建的django文件代码缩进有问题可以改,但是c盘都是源文件代码,没有改过,怎么会提示代码缩进错误提示呀,请教各位技术大咖,这个怎么改进呀。

2条回答 默认 最新

相关推荐 更多相似问题