This guide shows how to integrate the Python Form System with your existing LocumTele workflow.
# Copy Python system to your server
scp -r python-forms/ user@your-server:/path/to/locumtele/
# Install dependencies
cd /path/to/locumtele/python-forms/
pip3 install -r requirements.txt
# Run the system
python3 flask_app.py
Option A: Use Forms Dashboard (Recommended)
forms-dashboard.html
Option B: Use Python API Directly
Replace your existing JavaScript embeds with Python API calls:
<script src="https://locumtele.github.io/widgets/python-forms/components/universalFormLoader.js"></script>
<script>
const formData = { /* your form data */ };
await window.generateForm(formData, 'form-container');
</script>
<div id="form-container"></div>
<script>
fetch('https://your-server.com/api/generate-form', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
form_data: { /* your form data */ },
container_id: 'form-container'
})
})
.then(response => response.json())
.then(data => {
document.getElementById('form-container').innerHTML = data.html;
});
</script>
POST /api/generate-form
Content-Type: application/json
{
"form_data": {
"title": "Medical Screening",
"category": "weightloss",
"questions": [...]
},
"container_id": "form-container",
"options": {}
}
POST /api/process-state
Content-Type: application/json
{
"state_code": "CA",
"form_data": {...},
"category": "weightloss",
"location_id": "clinic_123",
"location_name": "Downtown Clinic",
"root_domain": "https://locumtele.com"
}
export FLASK_ENV=production
export WEBHOOK_URL=https://locumtele.app.n8n.cloud/webhook/patient-screener
export DEFAULT_ROOT_DOMAIN=https://locumtele.com
location /api/ {
proxy_pass http://localhost:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
curl https://your-server.com/api/info
tail -f /var/log/locumtele-python.log
cd python-forms/
python3 test_system.py
python3 integration_demo.py
python3 flask_app.py --port 5001
pip3 install -r requirements.txt
curl -X POST https://locumtele.app.n8n.cloud/webhook/patient-screener