ImportError: cannot import name 'password_reset'


#1

I’m on page 72 (of first book) trying to set up the password reset URLs. I copied in the URL patterns as listed and have the password templates in templates/registration.

I’m getting the following error:
from django.contrib.auth.views import ( ImportError: cannot import name 'password_reset'

According to this SO thread, it appears this no longer works?


#2

Sounds like you’re using Django 2.1 — FYI, this is why I say to use Django 2.0. :) https://hellowebbooks.com/setup/#install-django

The import statements have changed in 2.1, see this thread to switch things out: Django 2.1 changes?


#3

According to my system, it looks like I am somehow using 1.9 (based on the following)?

$ python -m django --version
1.9.9

EDIT: upgrading to Django 2.0 solved it.


#4

Hmmm that’s super weird.

Can you make sure you’re in your virtual environment, and then give me the output of pip freeze in your terminal so I can check the versions of everything?

Additionally, can you check in your urls.py and confirm you have the line to include urls from registration.backends.simple.urls?