Update app.py
Browse files68 unmodified lines6970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611751 unmodified lines16917017117217317417568 unmodified linesreturn blank_area, cost# Add debug section at the topst.title("π¦ Packaging Box Cost Calculator")# Debug sectionwith st.expander("π§ Debug & Testing"):st.write("Use this section to test your Google Sheets integration")if st.button("Test Webhook Connection"):status_code, response_text = test_webhook_connection()if status_code:if status_code == 200:st.success(f"β Webhook is reachable! Status: {status_code}")st.code(response_text)else:st.error(f"β Webhook returned status {status_code}")st.code(response_text)else:st.error(f"β Cannot reach webhook: {response_text}")debug_mode = st.checkbox("Enable Debug Mode (shows detailed logging info)")if st.button("Send Test Data"):test_data = {"company_name": "Test Company","box_length": 12.0,"box_width": 10.0,"box_height": 6.0,"material_type": "32 ECT C-Flute","moq": 1000,"current_price": 0.50,"blank_area": 5.625,"estimated_cost": 0.5625,"price_difference_percent": -11.1}success, message = send_to_google_sheet(test_data, debug=True)if success:st.success("β Test data sent successfully!")else:st.error(f"β Failed to send test data: {message}")st.markdown("---")# Input formcompany_name = st.text_input("Company Name*", placeholder="Enter your company name")51 unmodified lines}# Send data to Google Sheetssuccess, message = send_to_google_sheet(sheet_data, debug=debug_mode)if success:st.success("π Data logged successfully!")68 unmodified lines697071727374757651 unmodified lines12812913013113213313468 unmodified linesreturn blank_area, costst.title("π¦ Packaging Box Cost Calculator")# Input formcompany_name = st.text_input("Company Name*", placeholder="Enter your company name")51 unmodified lines}# Send data to Google Sheetssuccess, message = send_to_google_sheet(sheet_data)if success:st.success("π Data logged successfully!")
app.py+1-42