DSatishchandra commited on
Commit
01b8424
·
verified ·
1 Parent(s): f3093e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -2,18 +2,24 @@ from flask import Flask, render_template, request, jsonify, redirect, url_for, s
2
  import random
3
  from salesforce import get_salesforce_connection
4
  import os
5
- from flask import Flask, session
6
  from flask_session import Session
7
 
8
  # Initialize Flask app and Salesforce connection
 
9
  app = Flask(__name__)
 
 
 
10
  sf = get_salesforce_connection()
 
11
 
12
  # Set the secret key to handle sessions securely
13
  app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q") # Replace with a secure key
14
  app.config["SESSION_TYPE"] = "filesystem"
15
- Session(app)
16
 
 
 
 
17
 
18
  @app.route("/")
19
  def home():
@@ -282,4 +288,4 @@ def checkout():
282
  return jsonify({"success": False, "error": str(e)})
283
 
284
  if __name__ == "__main__":
285
- app.run(debug=True, host="0.0.0.0", port=8000)
 
2
  import random
3
  from salesforce import get_salesforce_connection
4
  import os
 
5
  from flask_session import Session
6
 
7
  # Initialize Flask app and Salesforce connection
8
+ print("Starting app...")
9
  app = Flask(__name__)
10
+ print("Flask app initialized.")
11
+
12
+ # Add debug logs in Salesforce connection setup
13
  sf = get_salesforce_connection()
14
+ print("Salesforce connection established.")
15
 
16
  # Set the secret key to handle sessions securely
17
  app.secret_key = os.getenv("SECRET_KEY", "sSSjyhInIsUohKpG8sHzty2q") # Replace with a secure key
18
  app.config["SESSION_TYPE"] = "filesystem"
 
19
 
20
+ # Check session initialization
21
+ Session(app)
22
+ print("Session configured.")
23
 
24
  @app.route("/")
25
  def home():
 
288
  return jsonify({"success": False, "error": str(e)})
289
 
290
  if __name__ == "__main__":
291
+ app.run(debug=False, host="0.0.0.0", port=7860)