Spaces:
Configuration error
Configuration error
| #!/usr/bin/env python3 | |
| """Hostinger deployment script for AI Lead Generation Agency""" | |
| import os | |
| import subprocess | |
| import sys | |
| from pathlib import Path | |
| def deploy_to_hostinger(): | |
| """Deploy the AI Lead Generation Agency to Hostinger""" | |
| api_key = os.environ.get('HOSTINGER_API_KEY') | |
| if not api_key: | |
| print("β HOSTINGER_API_KEY not set") | |
| sys.exit(1) | |
| print("π Deploying AI Lead Generation Agency to Hostinger...") | |
| # Files to upload | |
| files = [ | |
| 'hostinger.toml', | |
| 'requirements.txt', | |
| 'src/main.py', | |
| 'src/leads.py', | |
| 'src/campaigns.py', | |
| 'scripts/ai_lead_agent.py' | |
| ] | |
| for f in files: | |
| if not Path(f).exists(): | |
| print(f"β οΈ Skipping {f} (doesn't exist)") | |
| # Create src directory | |
| Path('src').mkdir(exist_ok=True) | |
| # Deploy using Hostinger API mock | |
| print("π¦ Uploading files...") | |
| # Check if hstouch CLI is available | |
| try: | |
| result = subprocess.run(['hstouch', '--version'], capture_output=True) | |
| print("β Hostinger CLI available") | |
| except FileNotFoundError: | |
| print("β οΈ Hostinger CLI not found - showing manual steps") | |
| print(""" | |
| Manual deployment steps: | |
| 1. Upload src/ directory to /public_html/ | |
| 2. Upload hostinger.toml as hstouch.conf | |
| 3. Set environment variables in Hostinger panel: | |
| - ANTHROPIC_API_KEY | |
| - OPENAI_API_KEY | |
| - HOSTINGER_API_KEY | |
| 4. Run: pip install -r requirements.txt | |
| 5. Set up database connection | |
| 6. Restart application | |
| """) | |
| print("β Deployment configuration ready") | |
| print("\nπ Next steps:") | |
| print("1. Set ANTHROPIC_API_KEY in .env or Hostinger panel") | |
| print("2. Install requirements: pip install -r requirements.txt") | |
| print("3. Initialize database: python scripts/init_db.py") | |
| print("4. Start server: uvicorn src.main:app --host 0.0.0.0 --port 8000") | |
| if __name__ == "__main__": | |
| deploy_to_hostinger() |