예제 #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
파일: env.py 프로젝트: ehenneken/myads
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
파일: env.py 프로젝트: romanchyla/myads
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
파일: wsgi.py 프로젝트: romanchyla/myads
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
파일: wsgi.py 프로젝트: romanchyla/myads
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
파일: cors.py 프로젝트: romanchyla/myads
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)