Manually generate Django password reset token

Ever needed to manually generate a password reset token?

For example, imagine this situation:
You create a user from a custom form, and you want the user to set his own password.
Solution: generate a password reset token,  email him the link, and let him choose his own password.

Here’s how you implement this:

To display the link in the email, you must set the password reset url, and display it: