44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Debug simple callback to see exact error
|
|
"""
|
|
|
|
import requests
|
|
import json
|
|
|
|
def debug_simple_callback():
|
|
"""Debug the simple callback"""
|
|
try:
|
|
callback_data = {
|
|
"output": "test-output.children",
|
|
"inputs": [
|
|
{
|
|
"id": "test-interval",
|
|
"property": "n_intervals",
|
|
"value": 1
|
|
}
|
|
]
|
|
}
|
|
|
|
print("Testing simple dashboard callback...")
|
|
response = requests.post(
|
|
'http://127.0.0.1:8052/_dash-update-component',
|
|
json=callback_data,
|
|
timeout=15,
|
|
headers={'Content-Type': 'application/json'}
|
|
)
|
|
|
|
print(f"Status Code: {response.status_code}")
|
|
|
|
if response.status_code == 500:
|
|
print("Error response:")
|
|
print(response.text)
|
|
else:
|
|
print("Success response:")
|
|
print(response.text[:500])
|
|
|
|
except Exception as e:
|
|
print(f"Request failed: {e}")
|
|
|
|
if __name__ == "__main__":
|
|
debug_simple_callback() |