mirror of
https://github.com/thecyberlearn/quantum-ai-v2.git
synced 2026-08-18 13:32:59 +00:00
- Add SITE_URL configuration that auto-detects Railway environment - Update forgot password view to use correct site URL in emails - Ensure password reset links work on both local and Railway deployments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
#!/usr/bin/env python
|
|
import os
|
|
import django
|
|
from django.conf import settings
|
|
|
|
# Setup Django
|
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'netcop_hub.settings')
|
|
django.setup()
|
|
|
|
from django.core.mail import send_mail
|
|
from authentication.models import User
|
|
|
|
# Test email sending
|
|
def test_email():
|
|
print("Testing email configuration...")
|
|
|
|
# Check settings
|
|
print(f"EMAIL_BACKEND: {settings.EMAIL_BACKEND}")
|
|
print(f"EMAIL_FILE_PATH: {getattr(settings, 'EMAIL_FILE_PATH', 'Not set')}")
|
|
|
|
# Send test email
|
|
try:
|
|
send_mail(
|
|
'Test Email',
|
|
'This is a test email from Django.',
|
|
settings.DEFAULT_FROM_EMAIL,
|
|
['test@example.com'],
|
|
fail_silently=False,
|
|
)
|
|
print("✅ Email sent successfully!")
|
|
print("📁 Check /tmp/app-messages/ for the email file")
|
|
|
|
# List files in email directory
|
|
import glob
|
|
files = glob.glob('/tmp/app-messages/*')
|
|
if files:
|
|
print(f"📧 Email files: {files}")
|
|
else:
|
|
print("⚠️ No email files found")
|
|
|
|
except Exception as e:
|
|
print(f"❌ Error sending email: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
test_email() |