I am following this tutorial for email verification.The version the author is working with is old.I got an error that said Reverse for 'activate' with keyword arguments '{'uidb64': b'OA', 'token': '4tm-3fcfb375c8ba14f9a95b'}
. I got that fixed through the first comment . The email got sent .But the link led to www.example.com . The second comment tells how to fix that . The comment was : For those are using Django 3, You should change some code
But I did not understand how to set SITE_ID to my sites pk.
In settings.py
set
BASE_URL = 'https://www.yourdomainname.com'
Don't include trailing /
Also, you have to mention this line in the same file
SITE_ID = 1
Moreover, go to your django admin
pannel , default is /admin
, and go to the sites
tab/model and add/edit your site
according to your ip/domainName
and display name
. This is the important part
to do.
If you are testing locally for now then you can use 127.0.0.1:8000
in your ip/domainName
and yourdomainNAme.com
in display name
If you are deploying or using live then you can use actual ip of your server into ip/domainname
or also you can use your domain name (as it's mapped to your ip via DNS system) and display name will be the same.
Hope, it will resolve your problem or issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.