Django User Registration - Password Reset via email

前端 未结 2 992
醉梦人生
醉梦人生 2021-02-04 17:41

As title explains.

Is there a built in method within Django 1.5 that handles user password resets? i.e. Via an email reset link?

Need my users to have a \"Forgot

2条回答
  •  不思量自难忘°
    2021-02-04 18:08

    You can use the default django-admin urls

    Add url('^', include('django.contrib.auth.urls')), to your urls.py

    Add email credentials to the settings.py

    # using gmail as my smtp server
    EMAIL_USE_TLS = True
    EMAIL_HOST = 'smtp.gmail.com'
    EMAIL_HOST_USER = 'example@gmail.com'
    EMAIL_HOST_PASSWORD = 'password'
    EMAIL_PORT = 587
    

    Then use the link http://baseurl/password_reset/

提交回复
热议问题