mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 06:55:53 +03:00
[GH-ISSUE #996] Hi, how to fix this error ,please help me, whenever user register it gives: SMTPAuthenticationError at /accounts/register/ (535, b'Incorrect authentication data') #695
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#695
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Rukisely on GitHub (Apr 21, 2024).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/996
I have my password in .env file which consitst of MAIL = name@sakuragroup.co.tz and PASSWORD = ********
settings.py:
`
mail = os.environ.get("MAIL")
mail_pass = os.environ.get("PASSWORD")
Email settings for Sakurahost SMTP server
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
EMAIL_HOST = "mail.sakurahost.co.tz"
EMAIL_PORT = 465 # Use port 465 for SMTP with SSL/TLS
EMAIL_USE_SSL = True # Use SSL/TLS for secure connection
EMAIL_HOST_USER = mail # Your email address
EMAIL_HOST_PASSWORD = mail_pass # Your email password
DEFAULT_FROM_EMAIL = mail # Sender email address
Additional settings for authentication and secure connection
EMAIL_USE_TLS = False # Since we're using SSL/TLS, set this to False
LOGIN_REDIRECT_URL = "/"
my views.pyfrom .forms import RegistrationFormfrom django.contrib.sites.shortcuts import get_current_site
from django.template.loader import render_to_string
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
from django.utils.encoding import force_bytes, force_str
from .tokens import account_activation_token
from django.core.mail import EmailMessage
from django.contrib import messages
from django.shortcuts import redirect, render
from django.contrib.auth import get_user_model, login
from django.urls import reverse
def index(request):
messages_to_display = messages.get_messages(request)
return render(request, "index.html", {"messages": messages_to_display})
def register_user(request):
form = RegistrationForm() # Initialize the form instance
if request.method == "POST":
form = RegistrationForm(request.POST)
if form.is_valid():
user = form.save(commit=False)
user.is_active = False
user.save()
def activate(request, uidb64, token):
User = get_user_model()
`