Пример #1
0
Файл: fcgi.py Проект: ajaxj/fkmv
#!/usr/bin/env python
from bak.fkmv import create_app

app = create_app('config.cfg')

from flup.server.fcgi import WSGIServer

WSGIServer(app, bindAddress='/tmp/pypress-master.sock').run()
Пример #2
0
Файл: fcgi.py Проект: ajaxj/fkmv
#!/usr/bin/env python
from bak.fkmv import create_app

app = create_app('config.cfg')

from flup.server.fcgi import WSGIServer
WSGIServer(app,bindAddress='/tmp/pypress-master.sock').run()
Пример #3
0
#!/usr/bin/env python
#coding=utf-8

#from flask.ext.script import Server, Shell, Manager, Command, prompt_bool
from flask.ext.script import Manager, Server, Shell, prompt_bool

from bak.fkmv import create_app
from bak.fkmv.extensions import db

manager = Manager(create_app('config.cfg'))

manager.add_command("runserver", Server('0.0.0.0', port=5000))


def _make_context():
    return dict(db=db)


manager.add_command("shell", Shell(make_context=_make_context))


@manager.command
def createall():
    "建立同步的数据库表"
    db.create_all()


@manager.command
def dropall():
    "清理数据库表"
    if prompt_bool("Are you sure ? You will lose all your data !"):
Пример #4
0
#!/usr/bin/env python
#coding=utf-8

#from flask.ext.script import Server, Shell, Manager, Command, prompt_bool
from flask.ext.script import Manager,Server,Shell,prompt_bool

from bak.fkmv import create_app
from bak.fkmv.extensions import db

manager = Manager(create_app('config.cfg'))

manager.add_command("runserver", Server('0.0.0.0',port=5000))

def _make_context():
    return dict(db=db)
manager.add_command("shell", Shell(make_context=_make_context))

@manager.command
def createall():
    "建立同步的数据库表"
    db.create_all()

@manager.command
def dropall():
    "清理数据库表"
    if prompt_bool("Are you sure ? You will lose all your data !"):
        db.drop_all()