0

My Django User Verification Email Link starts with http

Below is an example:

http://examplesitexxx.com/accounts/confirm-email/MTA:1poGIh:x7zOj4350ZP6uLhT0wUEp1CRE13jWrvRanofpFgTBkw/

I want to change the Verification URL that starts with 'https'.

So I access the file allauth/templates/account/email/email_confirmation_message.txt.

In this file I see {{ activate_url }}.

It should be a source of Verification Email URL but I can't figure out how to change the activate_url that start from https from http.

I just mentioned the above settings in this question but still if more code is required then tell me I'll update my question with that information.

Paolo
  • 20,112
  • 21
  • 72
  • 113
daylyroppo3
  • 79
  • 1
  • 9
  • In production or development? take a look [here](https://stackoverflow.com/questions/7610394/how-to-setup-ssl-on-a-local-django-server-to-test-a-facebook-app) – Hemal Patel Apr 17 '23 at 06:52
  • In development, I meant I want to know how to edit "Django-allauth" – daylyroppo3 Apr 17 '23 at 07:35

1 Answers1

0

you can update the ACCOUNT_DEFAULT_HTTP_PROTOCOL setting in your Django project settings file (settings.py). I done this few weeks ago.

Add the following line to your settings.py file:

ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"

This will change the default HTTP protocol used by the allauth app from "http" to "https". The activate_url variable in the email_confirmation_message.txt template will then use the updated default protocol.

Obviously, ensure that your Django project is running over HTTPS.

1ronmat
  • 1,147
  • 8
  • 15