makemigrations报错ImportError: cannot import name 'path' from 'django.urls'

在使用Django进行数据库迁移时遇到ImportError,具体为无法从'django.urls'导入'path'。问题源于将Django版本从2.2.4降至1.11.22,而'path'类在1.11版本中不存在。解决方案是将Django版本升级到2.X及以上。
摘要由CSDN通过智能技术生成

错误信息

PS D:\python\django\guanxiangzhiji> python manage.py makemigrations
Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "D:\app\anaconda\lib\site-packages\django\core\management\__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "D:\app\anaconda\lib\site-packages\django\core\management\__init__.py", line 356, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "D:\app\anaconda\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "D:\app\anaconda\lib\site-packages\django\core\management\base.py", line 327, in execute
    self.check()
  File "D:\app\anaconda\lib\site-packages\django\core\management\base.py", line 359, in check
    include_de
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值