__init__.py 642 B

12345678910111213141516171819202122
  1. from flask import Flask
  2. import os
  3. from flask_cors import CORS
  4. def create_app():
  5. SECRET_KEY = os.urandom(32)
  6. app = Flask(__name__)
  7. CORS(app, resources={r"/api/*": {"origins": "*"}})
  8. app.config['SECRET_KEY'] = SECRET_KEY
  9. from models.contents.routes import contents_app
  10. from models.manages.routes import manages_app
  11. from models.store_locations.routes import store_locations_app
  12. from models.statics.routes import statics_app
  13. app.register_blueprint(contents_app)
  14. app.register_blueprint(manages_app)
  15. app.register_blueprint(store_locations_app)
  16. app.register_blueprint(statics_app)
  17. return app