Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,20 @@ print("Salesforce connection established.")
|
|
18 |
|
19 |
# Set the secret key to handle sessions securely
|
20 |
app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q") # Replace with a secure key
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
# Configure the session type
|
23 |
app.config["SESSION_TYPE"] = "filesystem" # Use filesystem for session storage
|
@@ -724,4 +738,4 @@ def order_summary():
|
|
724 |
return render_template("order.html", order=None, error=str(e))
|
725 |
|
726 |
if __name__ == "__main__":
|
727 |
-
app.run(debug=
|
|
|
18 |
|
19 |
# Set the secret key to handle sessions securely
|
20 |
app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q") # Replace with a secure key
|
21 |
+
try:
|
22 |
+
sf = Salesforce(
|
23 |
+
username="[email protected]",
|
24 |
+
password="Sati@1020",
|
25 |
+
security_token="sSSjyhInIsUohKpG8sHzty2q"
|
26 |
+
)
|
27 |
+
print("✅ Successfully connected to Salesforce!")
|
28 |
+
except Exception as e:
|
29 |
+
print(f"❌ Salesforce connection failed: {e}")
|
30 |
+
exit(1) # Stop execution if connection fails
|
31 |
+
# ✅ Debugging session data
|
32 |
+
def print_session():
|
33 |
+
print(f"Session Data: {session}")
|
34 |
+
|
35 |
|
36 |
# Configure the session type
|
37 |
app.config["SESSION_TYPE"] = "filesystem" # Use filesystem for session storage
|
|
|
738 |
return render_template("order.html", order=None, error=str(e))
|
739 |
|
740 |
if __name__ == "__main__":
|
741 |
+
app.run(debug=True, host="0.0.0.0", port=7860)
|