Beispiel #1
0
def main():
    config = ConfigParser.ConfigParser()
    config.read('config')
    debug = config.get('cobra', 'debug')
    debug = bool(debug)
    web.debug = debug
    manager.run()
Beispiel #2
0
def main():
    DEBUG = (os.environ.get('DEBUG') == 'on')
    configure_logging(level=logging.DEBUG if DEBUG else logging.INFO)

    SENTRY_DSN = os.environ.get('SENTRY_DSN')
    if SENTRY_DSN:
        from raven.conf import setup_logging
        from raven.handlers.logging import SentryHandler
        setup_logging(SentryHandler(SENTRY_DSN, level=logging.ERROR))

    manager.run()
Beispiel #3
0
def main():
    try:
        config = ConfigParser.ConfigParser()
        config.read('config')
        debug = config.get('cobra', 'debug')
        debug = bool(debug)
    except ConfigParser.Error:
        debug = True
        log.critical("/config File Not Found, copy config.example to config please!")
    web.debug = debug
    manager.run()
@manager.command
def add_event_identifier():
    events = Event.query.all()
    for event in events:
        event.identifier = get_new_event_identifier()
        save_to_db(event)


@manager.option('-c', '--credentials', help='Super admin credentials. Eg. username:password')
def initialize_db(credentials):
    with app.app_context():
        populate_data = True
        inspector = reflection.Inspector.from_engine(db.engine)
        table_name = 'events'
        table_names = inspector.get_table_names()
        if table_name not in table_names:
            try:
                db.create_all()
                stamp()
            except:
                populate_data = False
                print "Could not create tables. Either database does not exist or tables already created"
            if populate_data:
                credentials = credentials.split(":")
                DataManager.create_super_admin(credentials[0], credentials[1])
                populate()


if __name__ == "__main__":
    manager.run()
Beispiel #5
0
from app import manager

if __name__ == '__main__':
    manager.run()

# Execute dentro da pasta Aula_flask o seguinte comando 'flask run'
Beispiel #6
0
def main():
    debug = config.Config('cobra', 'debug').value
    web.debug = bool(debug)
    manager.run()
Beispiel #7
0
def main():
    debug = config.Config('cobra', 'debug').value
    web.debug = bool(debug)
    manager.run()
Beispiel #8
0
#!/home/xiaozi/anaconda3/bin/python3.6
from app import app, manager

manager.run()  # python hello.py runserver --help
Beispiel #9
0
#! /usr/bin/env python
from app import manager

if __name__ == '__main__':
    manager.run(default_command='runserver')
from app import app,manager
from flask_report_system_models import *
from flask_report_system_api import *
try:
   db.create_all()
   db.session.commit()
except Exception as e:
   print(e)

if __name__ == '__main__':
   app.secret_key = 'super secret key'
   app.session_cookie_name = 'ffff'
   app.config['SESSION_TYPE'] = 'filesystem'
   manager.run()  # debug=True
Beispiel #11
0
def main():
    manager.run()
Beispiel #12
0
from app import manager

if __name__ == '__main__':
    manager.run()  #executar o servidor
Beispiel #13
0
from app import manager

if __name__ == '__main__':
    manager.run(host='0.0.0.0', ssl_context='adhoc')

Beispiel #14
0
def main():
    log.Log()
    debug = config.Config('cobra', 'debug').value
    web.debug = int(debug)
    manager.run()