Example #1
0
    async def on_startup():
        loop = get_ioloop()

        if config.EMAIL_ENABLE:
            asyncio.ensure_future(mail.init(loop), loop=loop)

        await redis_init(loop)

        if config.UPLOAD_ENABLE:
            qn.init()
Example #2
0
    async def on_startup():
        loop = get_ioloop()

        if config.EMAIL_ENABLE:
            asyncio.ensure_future(mail.init(loop), loop=loop)

        await redis_init(loop)

        if config.UPLOAD_ENABLE:
            if config.UPLOAD_BACKEND == 'qiniu':
                from lib import qn
                qn.init()
Example #3
0
import asyncio
from app import app
from lib import mail, upload
import config

if __name__ == '__main__':
    import model._models
    import view._views

    if config.EMAIL_ENABLE:
        loop = asyncio.get_event_loop()
        asyncio.ensure_future(mail.init(loop), loop=loop)

    if config.UPLOAD_ENABLE:
        upload.init()

    app.run(host=config.HOST, port=config.PORT)