Exemplo n.º 1
0
Arquivo: app.py Projeto: valish/miley
#!/usr/bin/env pythonNone
# -*-coding: utf-8 -*-

"""
    app.py
    ~~~~~~
    

    :copyright: (c) 2015 by Anonymous
    :license: see LICENSE for more details.
"""

from flask import Flask
from flask.ext.routing import router
import views
from configs import options, template_folder

urls = ("/partials/<path:partial>", views.Partial, "/<path:uri>", views.Base, "/", views.Base)
app = router(Flask(__name__, template_folder=template_folder), urls)

if __name__ == "__main__":
    app.run(**options)
Exemplo n.º 2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
    app.py
    ~~~~~~

    :copyright: (c) 2015 by Mek.
    :license: see LICENSE for more details.
"""

from flask import Flask
from flask.ext.routing import router
from flask.ext.cors import CORS
from views import endpoints
from configs import options, cors


urls = ('', endpoints)
app = router(Flask(__name__), urls)
cors = CORS(app) if cors else None




if __name__ == "__main__":
    app.run(**options)
Exemplo n.º 3
0
    :copyright: (c) 2017 by Mek.
    :license: see LICENSE for more details.
"""

from flask import Flask
from flask.ext.routing import router
from flask.ext.cors import CORS
from api import core, db
from views import CustomJSONEncoder
from views import v1
import configs

current_version = v1
urls = ('/v1', v1, '', current_version)
app = router(Flask(__name__), urls)
app.secret_key = configs.SECRET_KEY
app.json_encoder = CustomJSONEncoder
cors = CORS(app) if configs.cors else None

if configs.DEBUG or configs.UWSGI:
    import sys
    if sys.version_info < (3, 0):
        from flask.ext.superadmin import Admin, model
        admin = Admin(app)
        for model in core.Base._decl_class_registry:
            try:
                admin.register(core.Base._decl_class_registry[model],
                               session=db)
            except:
                pass
Exemplo n.º 4
0
#!/usr/bin/env pythonNone
#-*-coding: utf-8 -*-
"""
    app.py
    ~~~~~~
    

    :copyright: (c) 2015 by Anonymous
    :license: see LICENSE for more details.
"""

from flask import Flask
from flask.ext.routing import router
import views
from configs import options, template_folder

urls = ('/partials/<path:partial>', views.Partial, '/<path:uri>', views.Base,
        '/', views.Base)
app = router(Flask(__name__, template_folder=template_folder), urls)

if __name__ == "__main__":
    app.run(**options)