="lines-num lines-num-old"> 506
+        uid = force_text(urlsafe_base64_decode(uidb64))
507
+        user = User.objects.get(pk=uid)
508
+    except (TypeError, ValueError, OverflowError, User.DoesNotExist):
509
+        user = None
510
+
511
+    if user is not None and account_activation_token.check_token(user, token):
512
+        user.is_active = True
513
+        user.profile.email_confirmed = True
514
+        user.save()
515
+        login(request, user)
516
+        return redirect('front:index')
517
+    else:
518
+        return render(request, 'account_activation_invalid.html')
519
+
520
+def account_activation_sent(request):
521
+    return render(request, "fruit/account_activation_sent.html")

BIN
app/shaqfindbed/__pycache__/settings.cpython-39.pyc


+ 7 - 0
app/shaqfindbed/settings.py

@@ -74,6 +74,13 @@ MIDDLEWARE = [
74 74
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
75 75
 ]
76 76
 
77
+EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
78
+EMAIL_HOST = 'smtp.gmail.com'
79
+EMAIL_HOST_USER = 'tech@simplico.net'
80
+EMAIL_HOST_PASSWORD = 'SteveJobs1984'
81
+EMAIL_PORT = 587
82
+EMAIL_USE_TLS = True
83
+DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
77 84
 ROOT_URLCONF = 'shaqfindbed.urls'
78 85
 
79 86
 TEMPLATES = [

tum/ecoloop - Gogs: Simplico Git Service

1 次代碼提交 (main)

作者 SHA1 備註 提交日期
  tum a5d82c3daa first commit 3 月之前