main.py~ 668 B

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