Django 运行manage.py 报错解决办法(ImportError)

django项目中运行django-bootstrap-toolkit-master\demo_project\manage.py报错

python manage.py runserver 
###
Traceback (most recent call last):  
  File "manage.py", line 2, in <module>  
    from django.core.management import execute_manager  
ImportError: cannot import name execute_manager   

原因是django中没有execute_manager

应将上述import execute_manager 修改为 import execute_from_command_line

附修改后的manage.py

#!/usr/bin/env python  

import os  
import sys  
  
if __name__ == "__main__":  
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")  
  
    from django.core.management import execute_from_command_line  
  
    execute_from_command_line(sys.argv)  

原创文章,作者:Tina,如若转载,请注明出处:https://python.01314.cn/201507233.html