浅鱼

解决ImportError: No module named 'django.core.urlresolvers'
错误:ImportError: No module named 'django.core.urlresolvers...
扫描右侧二维码阅读全文
14
2018/07

解决ImportError: No module named 'django.core.urlresolvers'

错误:

ImportError: No module named 'django.core.urlresolvers'

解决办法:

将Python文件中的from django.core.urlresolvers import reverse改为from django.urls import reverse

原因:

Django 2.0 removes the django.core.urlresolvers module, which was moved to django.urls in version 1.10. You should change any import to use django.urls instead.

参考文献:
1.https://docs.djangoproject.com/en/2.0/releases/1.9/#features-deprecated-in-1-9
2.https://stackoverflow.com/questions/43139081/importerror-no-module-named-django-core-urlresolvers

Last modification:July 14th, 2018 at 08:32 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment