middha commited on
Commit
ea04fa2
·
verified ·
1 Parent(s): 4fe6ffa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -399,9 +399,10 @@ def download_jobs():
399
  mimetype='text/csv',
400
  headers={"Content-Disposition": "attachment;filename=jobs.csv"}
401
  )
402
-
403
  if __name__ == "__main__":
404
- # Convert Excel serial dates before first request
405
  with app.app_context():
 
406
  convert_excel_serial_dates()
407
- app.run(host="0.0.0.0", port=5000, debug=True)
 
 
399
  mimetype='text/csv',
400
  headers={"Content-Disposition": "attachment;filename=jobs.csv"}
401
  )
 
402
  if __name__ == "__main__":
403
+ # Create tables & migrate dates before serving
404
  with app.app_context():
405
+ db.create_all()
406
  convert_excel_serial_dates()
407
+ port = int(os.environ.get("PORT", 5000))
408
+ app.run(host="0.0.0.0", port=port, debug=False, use_reloader=False)