英文:
How to Edit the Django User Verification Email Link
问题
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 starts from https
to 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.
英文:
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.
答案1
得分: 0
你可以在你的Django项目设置文件(settings.py)中更新ACCOUNT_DEFAULT_HTTP_PROTOCOL设置。我几周前已经完成了这个操作。
将以下行添加到你的settings.py文件中:
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
这将把allauth应用程序使用的默认HTTP协议从"http"更改为"https"。然后,email_confirmation_message.txt模板中的activate_url变量将使用更新后的默认协议。
当然,确保你的Django项目在HTTPS上运行。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论