main.py 687 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/python3
  2. from flask import Flask
  3. from pymongo import MongoClient
  4. from pymongo.collation import Collation
  5. from view.adm import adm
  6. from view.default import init_page
  7. import os
  8. # Conectio my
  9. client = MongoClient('mongodb://root:r00t123@ds259001.mlab.com',59001)
  10. db = client.weed
  11. # from view.default import default
  12. from flask_assets import Environment, Bundle
  13. app = Flask(__name__)
  14. assets = Environment(app)
  15. # Here views for layout
  16. # app.register_blueprint(default)
  17. app.register_blueprint(adm)
  18. app.register_blueprint(init_page)
  19. app.secret_key = os.urandom(12)
  20. if __name__ == "__main__":
  21. port = int(os.environ.get("PORT", 5000))
  22. app.run(host='0.0.0.0', port=port)