If you are using Django3,
pip install six
add six to the settings.py INSTALLED_APPS and migrate.
six
settings.py
INSTALLED_APPS
from django.contrib.auth.tokens import PasswordResetTokenGenerator from six import text_type class AccountActivationTokenGenerator(PasswordResetTokenGenerator): def _make_hash_value(self, user, timestamp): return ( text_type(user.pk) + text_type(timestamp) + text_type(user.profile.signup_confirmation) ) account_activation_token = AccountActivationTokenGenerator()
Worked great, adding to setting.py, huge thanks
hey this doesn't work for me... you say add six to settings.py, do you mean like this ?
INSTALLED_APPS = [ ... 'django.contrib.staticfiles', 'six', ]
Because I always get "Name 'six' is not defined" And then what do I have to migrate ?
That’s right. Can you try pip freeze and check, six was installed correctly?
I managed to fix it after a few tries, so it's good now :)
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you are using Django3,
pip install six
add
six
to thesettings.py
INSTALLED_APPS
and migrate.Worked great, adding to setting.py, huge thanks
hey this doesn't work for me... you say add six to settings.py, do you mean like this ?
Because I always get "Name 'six' is not defined"
And then what do I have to migrate ?
That’s right. Can you try pip freeze and check, six was installed correctly?
I managed to fix it after a few tries, so it's good now :)