Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

main.py 635 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  1. from email_classifier.spam_or_ham_classifier.routes_and_forms.routes import app
  2. import os
  3. if __name__ == '__main__':
  4. # Heroku provides environment variable 'PORT' that should be listened on by Flask
  5. port = os.environ.get('PORT')
  6. if port:
  7. # 'PORT' variable exists - running on Heroku, listen on external IP and on given by Heroku port
  8. app.run(host='0.0.0.0', port=int(port))
  9. else:
  10. # 'PORT' variable doesn't exist, running not on Heroku, presumabely running locally, run with default
  11. # values for Flask (listening only on localhost on default Flask port)
  12. app.run(debug=True)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...