Fix Zoho connection issues and add local testing capabilities
- Fixed 'days_back' parameter error in zoho_client.py - Added robust settings validation in app.py to prevent int() errors - Created LOCAL_TESTING.md with comprehensive testing guide - Added run_local.sh for easy local server setup - Added deploy_updates.sh for deployment instructions - Added test_local_connection.py for automated testing - Updated config.json with proper structure - All fixes tested and working locally
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
# Local Testing Guide
|
||||
|
||||
This guide helps you test the Email Alerts Application locally.
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### Option 1: Use the automated script
|
||||
```bash
|
||||
./run_local.sh
|
||||
```
|
||||
|
||||
### Option 2: Manual setup
|
||||
```bash
|
||||
# Activate virtual environment
|
||||
source venv/bin/activate
|
||||
|
||||
# Install dependencies
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Start the server
|
||||
python run_server.py
|
||||
```
|
||||
|
||||
## 🌐 Access the Application
|
||||
|
||||
Once the server is running, you can access:
|
||||
|
||||
- **Dashboard**: http://localhost:5237/
|
||||
- **Settings**: http://localhost:5237/settings
|
||||
|
||||
## 🧪 Testing the Connection
|
||||
|
||||
### Step 1: Configure Credentials
|
||||
1. Go to http://localhost:5237/settings
|
||||
2. Enter the Zoho credentials:
|
||||
- **Email**: `projects@manaknightdigital.com`
|
||||
- **Password**: `4o%!sbk$(3!>@#567!!`
|
||||
3. Click "Save Settings"
|
||||
|
||||
### Step 2: Test Connection
|
||||
1. Click "Test Connection" button
|
||||
2. You should see: "Connection successful! Found X emails in the last 7 days."
|
||||
|
||||
## 🔧 Troubleshooting
|
||||
|
||||
### If you get "days_back" error:
|
||||
- The server is running old code
|
||||
- Restart the server: `Ctrl+C` then run `./run_local.sh` again
|
||||
|
||||
### If you get "ModuleNotFoundError":
|
||||
- Make sure you're using the virtual environment: `source venv/bin/activate`
|
||||
|
||||
### If port 5237 is in use:
|
||||
- The script will automatically kill existing processes
|
||||
- Or manually: `pkill -f "python.*run_server.py"`
|
||||
|
||||
## 📋 Test Checklist
|
||||
|
||||
- [ ] Server starts without errors
|
||||
- [ ] Web interface loads at http://localhost:5237/
|
||||
- [ ] Settings page loads at http://localhost:5237/settings
|
||||
- [ ] Can enter Zoho credentials
|
||||
- [ ] "Test Connection" works without "days_back" error
|
||||
- [ ] Connection shows "successful" message
|
||||
|
||||
## 🎯 Expected Results
|
||||
|
||||
✅ **Success**: "Connection successful! Found X emails in the last 7 days."
|
||||
❌ **Old Error**: "Connection failed: ZohoClient.fetch_emails() got an unexpected keyword argument 'days_back'"
|
||||
|
||||
## 🛑 Stopping the Server
|
||||
|
||||
Press `Ctrl+C` in the terminal where the server is running.
|
||||
|
||||
## 📁 Files for Testing
|
||||
|
||||
- `run_local.sh` - Automated local startup script
|
||||
- `test_local_connection.py` - Connection test script
|
||||
- `zoho_client.py` - Fixed with days_back parameter
|
||||
- `config.json` - Clean configuration (no hardcoded credentials)
|
||||
Reference in New Issue
Block a user