[Answered ]-ViewDoesNotExist at / Could not import django.views.generic.simple.redirect_to. Parent module django.views.generic.simple does not exist

3👍

I realise this question is two years old, but I also hit this while upgrading an old project. The url structure

url(r'^$', 'django.views.generic.simple.redirect_to', {'url': 'whatever' }),

Was removed and replaced with;

from django.views.generic import RedirectView
url(r'^$', RedirectView.as_view(url='/whatever'),permanent=True)

-1👍

The error is clear. That module does not exist. That is because it was deprecated and removed two versions ago. You should follow the correct documentation for the version of Django you are using.

Leave a comment