JWT Authenticator (Python + Flask)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app.py 520B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. from flask import Flask
  4. from flask_sqlalchemy import SQLAlchemy
  5. from flask_cors import CORS
  6. import os
  7. app = Flask(__name__)
  8. CORS(app)
  9. db = None
  10. def initialize_app(config=None):
  11. global db
  12. if not config:
  13. app.config.from_object('config')
  14. else:
  15. app.config.update(**config)
  16. if 'JAWTH_CONFIG' in os.environ.keys():
  17. app.config.from_envvar('JAWTH_CONFIG')
  18. db = SQLAlchemy(app)
  19. import models
  20. db.create_all()
  21. import views