From 402324c03e95e6bde4c3a11145f7433af67874f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Jul 2025 10:10:46 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20Update=20domain=20configurations?= =?UTF-8?q?=20for=20www.quantumtaskai.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add www.quantumtaskai.com to ALLOWED_HOSTS - Update CSRF_TRUSTED_ORIGINS for both www and non-www domains - Change SITE_URL to use production domain for emails - Update Stripe fallback URLs to use www subdomain - Change admin emails from netcop.ai to quantumtaskai.com - Update management command URLs to production domain - Add Email Writer agent to populate_agents script šŸ¤– Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- agent_base/management/commands/populate_agents.py | 13 +++++++++++-- core/management/commands/check_admin.py | 6 +++--- core/management/commands/reset_admin.py | 2 +- netcop_hub/settings.py | 10 +++++----- wallet/stripe_handler.py | 4 ++-- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/agent_base/management/commands/populate_agents.py b/agent_base/management/commands/populate_agents.py index 342c510..c87984b 100644 --- a/agent_base/management/commands/populate_agents.py +++ b/agent_base/management/commands/populate_agents.py @@ -23,7 +23,7 @@ class Command(BaseCommand): if should_create_admin: # Check if admin email already exists - admin_email = 'admin@netcop.ai' + admin_email = 'admin@quantumtaskai.com' if User.objects.filter(email=admin_email).exists(): self.stdout.write(f"Admin user with email {admin_email} already exists - skipping creation") else: @@ -34,7 +34,7 @@ class Command(BaseCommand): first_name='Admin', last_name='User' ) - self.stdout.write("Created superuser: admin@netcop.ai / admin123") + self.stdout.write("Created superuser: admin@quantumtaskai.com / admin123") else: superuser_count = User.objects.filter(is_superuser=True).count() self.stdout.write(f"Superuser(s) already exist ({superuser_count} found) - skipping admin creation") @@ -87,6 +87,15 @@ class Command(BaseCommand): 'icon': 'šŸ”', 'agent_type': 'webhook', }, + { + 'name': 'Email Writer', + 'slug': 'email-writer', + 'description': 'Generate professional emails for any purpose. Perfect for business communications, customer outreach, and personal correspondence.', + 'category': 'content', + 'price': 3.0, + 'icon': 'āœ‰ļø', + 'agent_type': 'api', + }, ] created_count = 0 diff --git a/core/management/commands/check_admin.py b/core/management/commands/check_admin.py index e9b127d..a792f71 100644 --- a/core/management/commands/check_admin.py +++ b/core/management/commands/check_admin.py @@ -8,8 +8,8 @@ class Command(BaseCommand): help = 'Check and fix admin user status' def handle(self, *args, **options): - # Check both possible admin emails - possible_emails = ['admin@netcop.ai', 'admin@quantumtaskai.com'] + # Check both possible admin emails (preferred email first) + possible_emails = ['admin@quantumtaskai.com', 'admin@netcop.ai'] username = 'admin' password = 'QuantumAI2024!' @@ -49,7 +49,7 @@ class Command(BaseCommand): # Show login instructions self.stdout.write("\nšŸ“ Login Instructions:") - self.stdout.write(f"URL: https://quantum-ai.up.railway.app/admin/") + self.stdout.write(f"URL: https://www.quantumtaskai.com/admin/") self.stdout.write(f"Email: {found_email}") self.stdout.write(f"Username: {username}") self.stdout.write(f"Password: {password}") diff --git a/core/management/commands/reset_admin.py b/core/management/commands/reset_admin.py index 996cfc6..aa9f6c9 100644 --- a/core/management/commands/reset_admin.py +++ b/core/management/commands/reset_admin.py @@ -65,7 +65,7 @@ class Command(BaseCommand): self.stdout.write(f"šŸ’° Balance: {user.wallet_balance} AED") self.stdout.write("\nšŸŽÆ Login Instructions:") - self.stdout.write("URL: https://quantum-ai.up.railway.app/admin/") + self.stdout.write("URL: https://www.quantumtaskai.com/admin/") self.stdout.write(f"Email: {email}") self.stdout.write(f"Username: {username}") self.stdout.write(f"Password: {password}") diff --git a/netcop_hub/settings.py b/netcop_hub/settings.py index 426abab..c546be3 100644 --- a/netcop_hub/settings.py +++ b/netcop_hub/settings.py @@ -52,12 +52,12 @@ if missing_vars: # SECURITY WARNING: don't run with debug turned on in production! DEBUG = config('DEBUG', default=True, cast=bool) -ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='localhost,127.0.0.1,testserver,quantumtaskai.com').split(',') +ALLOWED_HOSTS = config('ALLOWED_HOSTS', default='localhost,127.0.0.1,testserver,quantumtaskai.com,www.quantumtaskai.com').split(',') # Site URL configuration for emails if config('RAILWAY_ENVIRONMENT', default=''): - # Use actual Railway domain for email verification links - SITE_URL = 'https://quantum-ai.up.railway.app' + # Use production domain for email verification links + SITE_URL = 'https://www.quantumtaskai.com' else: SITE_URL = config('SITE_URL', default='http://localhost:8000') @@ -315,8 +315,8 @@ if config('RAILWAY_ENVIRONMENT', default=''): if railway_url and f'https://{railway_url}' not in CSRF_TRUSTED_ORIGINS: CSRF_TRUSTED_ORIGINS.append(f'https://{railway_url}') - # Also add production domain - CSRF_TRUSTED_ORIGINS.append('https://quantumtaskai.com') + # Also add production domains (both www and non-www) + CSRF_TRUSTED_ORIGINS.extend(['https://quantumtaskai.com', 'https://www.quantumtaskai.com']) # Railway-specific optimizations USE_X_FORWARDED_HOST = True diff --git a/wallet/stripe_handler.py b/wallet/stripe_handler.py index d3fa38c..dd9ae32 100644 --- a/wallet/stripe_handler.py +++ b/wallet/stripe_handler.py @@ -31,8 +31,8 @@ class StripePaymentHandler: cancel_url = request.build_absolute_uri('/wallet/top-up/cancel/') else: # Fallback URLs - success_url = 'https://quantumtaskai.com/wallet/top-up/success/?session_id={CHECKOUT_SESSION_ID}' - cancel_url = 'https://quantumtaskai.com/wallet/top-up/cancel/' + success_url = 'https://www.quantumtaskai.com/wallet/top-up/success/?session_id={CHECKOUT_SESSION_ID}' + cancel_url = 'https://www.quantumtaskai.com/wallet/top-up/cancel/' try: logger.info(f"Creating checkout session for user {user.id}, amount: {amount} AED")