Пример #1
0
 def create_app(self):
     '''Start the wsgi application'''
     a = app.create_app(**{
            'SQLALCHEMY_BINDS': {'myads': 'sqlite:///'},
            'SQLALCHEMY_ECHO': False,
            'TESTING': True,
            'PROPAGATE_EXCEPTIONS': True,
            'TRAP_BAD_REQUEST_ERRORS': True
         })
     db.create_all(app=a)
     return a
Пример #2
0
 def create_app(self):
     '''Start the wsgi application'''
     a = app.create_app(**{
            'SQLALCHEMY_BINDS': {'myads': 'sqlite:///'},
            'SQLALCHEMY_ECHO': True,
            'TESTING': True,
            'PROPAGATE_EXCEPTIONS': True,
            'TRAP_BAD_REQUEST_ERRORS': True
         })
     db.create_all(app=a, bind=['myads'])
     return a
Пример #3
0
def get_app_config(key):
    opath = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
    if opath not in sys.path:
        sys.path.insert(0, opath)
        
    from myads_service import app as application
    app = application.create_app()
    
    with app.app_context() as c:
        print 'Getting actual config for', key, app.config.get(key)
        return app.config.get(key)
Пример #4
0
def get_app_config(key):
    opath = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
    if opath not in sys.path:
        sys.path.insert(0, opath)

    from myads_service import app as application
    app = application.create_app()

    with app.app_context() as c:
        print 'Getting actual config for', key, app.config.get(key)
        return app.config.get(key)
Пример #5
0
 def create_app(self):
     '''Start the wsgi application'''
     from myads_service import app 
     a = app.create_app(**{
            'SQLALCHEMY_DATABASE_URI': 'sqlite://',
            'SQLALCHEMY_ECHO': False,
            'TESTING': True,
            'PROPAGATE_EXCEPTIONS': True,
            'TRAP_BAD_REQUEST_ERRORS': True
         })
     db.create_all(app=a)
     return a
Пример #6
0
 def create_app(self):
     '''Start the wsgi application'''
     a = app.create_app(
         **{
             'SQLALCHEMY_BINDS': {
                 'myads': 'sqlite:///'
             },
             'SQLALCHEMY_ECHO': True,
             'TESTING': True,
             'PROPAGATE_EXCEPTIONS': True,
             'TRAP_BAD_REQUEST_ERRORS': True,
             'MYADS_BUMBLEBEE_OPTIONS': {
                 'foo': 'bar'
             }
         })
     db.create_all(app=a, bind=['myads'])
     return a
Пример #7
0
from werkzeug.serving import run_simple
from myads_service import app

application = app.create_app()

if __name__ == "__main__":
    run_simple('0.0.0.0',
               5000,
               application,
               use_reloader=False,
               use_debugger=False)
Пример #8
0
from werkzeug.serving import run_simple
from myads_service import app

application = app.create_app()

if __name__ == "__main__":
    run_simple("0.0.0.0", 5000, application, use_reloader=False, use_debugger=False)
Пример #9
0
from flask_cors import CORS
from myads_service.app import create_app

if __name__ == '__main__':
    app = create_app()
    cors = CORS(app, allow_headers=('Content-Type', 'Authorization', 'X-BB-Api-Client-Version'))
    app.run('0.0.0.0', port=5000, debug=True)