예제 #1
0
"""
import os
import sys


"""
Import Application specific dependencies
"""
from CommonsCloudAPI import create_application


"""
Start the application

Ensure that the virtual environment has been properly activated and if it
has been, then the application should be run, using the initialize_application
method provided so comply with the Application Factory pattern

"""
if __name__ == "__main__":

    if len(sys.argv) > 1 and sys.argv[1]:
        if sys.argv[1] == 'development':
            os.environ['DEBUG'] = 'true'
            
        CommonsCloudAPI = create_application(__name__, env=sys.argv[1])
        CommonsCloudAPI.run()
    else:
        CommonsCloudAPI = create_application(__name__)
        CommonsCloudAPI.run()
예제 #2
0
 def create_app(self):
   app = create_application(__name__, env='testing')
   app.config['TESTING'] = True
   return app