Skip to content
Advertisement

‘microsecond’ is an invalid keyword argument for replace()

I am using Django 2.0+ and am attempting to just plug in the existing password reset function into my website. If the email does not exist, it successfully submits. If it DOES exist, I get this error:

'microsecond' is an invalid keyword argument for replace()

I never touched any of the backend code for this function so I would assume it would just work out of the box.

Traceback:

JavaScript

I do have a CustomUser model I use, but I can’t see if there is a connection or, if so, where the connection might be with that.

Help!

Advertisement

Answer

Just go to the tokens.py file (for me, it was located here: AppDataLocalProgramsPythonPython38-32Libsite-packagesdjangocontribauthtokens.py ) and change the following line:

JavaScript

to

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement