Django Registration + Django Auth - Part 2
LOGIN_URL = "/"
LOGIN_REDIRECT_URL = "/"

LOGOUT_REDIRECT_URL = "/"

EMAIL_USE_TLS = True
EMAIL_HOST = 'mail.yourhost.com'
EMAIL_HOST_USER = 'admin@youremail.com'
EMAIL_HOST_PASSWORD = *********
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = 'admin@youremail.com'

ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window



Send the emails to the console(for testing)

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'


Send the emails using SMTP 

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'


 

http://{{ site.domain }}{% url 'django_registration_activate' activation_key %}

 

<form method="post" action=".">
  {% csrf_token %}
  {{ form.as_p }}

  <input type="submit" value="Submit" />
</form>

 

<form method="post" action=".">
  {% csrf_token %}
  {{ form.as_p }}

  <input type="submit" value="Log in" />
  <input type="hidden" name="next" value="{{ next }}" />
</form>

 


Python 3.12
Django==4.2
django-registration==3.3


15 Feb. 2024 | Last Updated: 22 Nov. 2025 | jaimedcsilva

Related
  • Django Registration + Django Auth - Part 1
  • Django Registration + Django Auth - Part 2
  • Django Registration + Django Auth - Part 3
  • Django Registration + Django Auth - Part 4
  • Adding Google reCapthca - Part 5
  • Adding Google Recapthca - Part 6

  • Buy Me a Coffee