示例#1
0
文件: cobra.py 项目: MarquisF/cobra
def main():
    config = ConfigParser.ConfigParser()
    config.read('config')
    debug = config.get('cobra', 'debug')
    debug = bool(debug)
    web.debug = debug
    manager.run()
示例#2
0
文件: manage.py 项目: eea/ldaplog
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()
示例#3
0
文件: cobra.py 项目: LoveWalter/cobra
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()
示例#4
0
@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()
示例#5
0
from app import manager

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

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

manager.run()  # python hello.py runserver --help
示例#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
示例#11
0
def main():
    manager.run()
示例#12
0
from app import manager

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

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

示例#14
0
文件: cobra.py 项目: xzblueidea/cobra
def main():
    log.Log()
    debug = config.Config('cobra', 'debug').value
    web.debug = int(debug)
    manager.run()