Importerror: No Module Named 'Django.Core.Urlresolvers'

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

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, like this:

from django.urls import reverse

Note that Django 2.0 removes some features that previously were in django.core.urlresolvers, so you might have to make some more changes before your code works. See the features deprecated in 1.9 for details on those additional changes.

No module named 'django.core.urlresolvers when using uni_form

django-uni-form has not been developed for years. As the project page says, you should use django-crispy-forms instead.

No module named django.core.urlresovers in django 2.0a1

In Django 2.0 you must import:
from django.urls import reverse_lazy

I'm getting error when trying to import reserve from urlresolver

From Django 1.10+, the import has changed to:

from django.urls import reverse

However, the old import should still work in Django 1.10 and 1.11.

If the old import is giving you an error, that suggests that either your Django install is broken, or you have installed the master branch of Django (which will become 2.0). I would avoid using the master branch.

If possible, use the same Django version that the tutorial was written for, otherwise you might hit more problems like this. If the tutorial was written for Django < 1.8 then I would avoid it, as it is out of date.



Related Topics



Leave a reply



Submit