Beispiel #1
0
def main(host='0.0.0.0', port='80'):
    @manager.command
    def run():
        app.run(host=host, port=port)

    manager.run(
    )  #python3 app.py run [will use the above config] else use runserver --port 5001
Beispiel #2
0
#! /usr/bin/env python
#import sys
#print(sys.path)
from gevent.pywsgi import WSGIServer
from manage import application, manager

#http_server = WSGIServer(('', 8000), application)
#http_server.serve_forever()
#manager.run()
if __name__ == "__main__":
    application.run(threaded=True)
    manager.run()
    print('hi app')
Beispiel #3
0
@manager.command
def start_project(testing=False):
    template_dir = os.path.join(current_app.config.get('MRBOB_TEMPLATE_DIR'),'project')
    run_mrbob(template_dir,testing)


def main():
    func = None
    testing = True
    if len(sys.argv) <= 1:
        print_usage()
    else:
        if sys.argv[1] == 'start-project':
            func = start_project
        elif sys.argv[1] == 'start-blueprint':
            func = start_blueprint
        else:
            raise ValueError
            sys.exit()
        if len(sys.argv) > 2:
            if sys.argv[2] == '-t' or sys.argv[2] == '--testing':
                testing = True
            else:
                testing = False
        if func is not None:
            func(testing)

if __name__ == "__main__":
    with flaskxxl.context() as ctx:
        manager.run()
#!/usr/bin/python
import os
# from application.settings import DB_USER_ID, DB_USER_PASSWORD, DB_HOST_NAME, DB_HOST_PORT, DB_NAME

os.system('pip2 install -r requirements.txt')
# os.system('mysqladmin -u'+str(DB_USER_ID)+' -h'+DB_HOST_NAME+' -P'+DB_HOST_PORT+' -p'+DB_USER_PASSWORD+' drop '+str(DB_NAME))
# os.system('mysqladmin -u'+str(DB_USER_ID)+' -h'+DB_HOST_NAME+' -P'+DB_HOST_PORT+' -p'+DB_USER_PASSWORD+' create '+str(DB_NAME))
os.chdir('./alembic/versions')
os.system('rm *')
os.chdir('../..')
os.system('alembic revision --autogenerate -m "Alembic initilized boilerplate tables."')
os.system('alembic upgrade head')
os.system('python2 install_node_modules.py')
os.system('python2 refresh_static.py')
from manage import manager
manager.run(default_command='init_user')
Beispiel #5
0
from manage import manager

manager.run(default_command="runserver")