Exemple #1
0
def register_blueprints():
    # 
    # Register the blueprints in the application
    # 
    app.register_blueprint(basic_http_blueprint, url_prefix='/labmanager')
    app.register_blueprint(lti_blueprint, url_prefix='/lti')
    app.register_blueprint(opensocial_blueprint, url_prefix='/os')
    app.register_blueprint(opensocial_blueprint, url_prefix='/opensocial')

    from labmanager.rlms.base import _BLUEPRINTS
    for url, blueprint in _BLUEPRINTS.items():
        app.register_blueprint(blueprint, url_prefix='/rlms' + url)
Exemple #2
0
from web.controllers.index import index_blueprint
from web.controllers.user import user_blueprint
from web.controllers.static import static_blueprint
from web.controllers.account import account_buleprint
from web.controllers.stat import stat_blueprint
from web.controllers.food import food_blueprint
from web.controllers.member import member_blueprint
from web.controllers.finance import finance_blueprint
from application import app

# 注册蓝图
app.register_blueprint(index_blueprint, url_prefix="/")
app.register_blueprint(user_blueprint, url_prefix="/user")
app.register_blueprint(static_blueprint, url_prefix="/static")
app.register_blueprint(account_buleprint, url_prefix="/account")
app.register_blueprint(food_blueprint, url_prefix="/food")
app.register_blueprint(stat_blueprint, url_prefix="/stat")
app.register_blueprint(member_blueprint, url_prefix="/member")
app.register_blueprint(finance_blueprint, url_prefix="/finance")
Exemple #3
0
from application import app

from web.controllers.newe import route_newe
from web.interrupt.interrupt import *

app.register_blueprint(route_newe, url_prefix='/newe')
Exemple #4
0
def setting_modules(app, modules):
    """ 注册Blueprint模块 """
    for module, url_prefix in modules:
        app.register_blueprint(module, url_prefix=url_prefix)
Exemple #5
0
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============================================================================

# ============= enthought library imports =======================
# ============= standard library imports ========================
from flask import render_template
# ============= local library imports  ==========================

from application import app
from blueprints.v0_docs import docs
from api.v0_api import create_api

app.register_blueprint(docs)
create_api(app)

@app.route('/')
def index():
    return render_template('index.html')


@app.route('/api/')
def api():
    return render_template('api.html')


@app.route('/api/info')
def api_info():
    return render_template('api_info.html')
Exemple #6
0
# -*- coding: utf-8 -*-
from application import app
from web.controllers.index import route_index
from web.controllers.user.User import route_user
from web.controllers.static import route_static

app.register_blueprint(route_index, url_prefix="/")
app.register_blueprint(route_user, url_prefix="/user")
app.register_blueprint(route_static, url_prefix="/static")
Exemple #7
0
# -*- coding: utf-8 -*-
from application import app
from web.controllers.index import route_index
from web.controllers.manager.manager import route_manager

app.register_blueprint( route_index,url_prefix = "/" )
app.register_blueprint( route_manager,url_prefix = "/manager" )
Exemple #8
0
from application import app
from web.controllers.index import route_index

app.register_blueprint(route_index, url_prefix="/")
#!/usr/bin/env python
# -*- coding:utf-8 -*-

from application import app
from flask_script import Manager

# 附加路由和自定义的错误页面
from application.controllers import main as main_blueprint
from application.controllers import zhihu as zhihu_blueprint

app.register_blueprint(main_blueprint)
app.register_blueprint(zhihu_blueprint)

manager = Manager(app)

if __name__ == '__main__':
    manager.run()
Exemple #10
0
# 路由注册及web项目相关的事情

from application import app
from controllers.index import index_page



app.register_blueprint(index_page,url_prefix='/')
Exemple #11
0
# -*- encoding:utf-8 -*-

__date__ = '2018/12/25/025 18:23'

from application import app

from web.admin.views import blueprint_admin
from web.home.views import blueprint_home
from wechat import blueprint_wechat
from api.v1 import blueprint_v1

app.register_blueprint(blueprint_admin(), url_prefix="/admin")
app.register_blueprint(blueprint_home(), url_prefix="/")
app.register_blueprint(blueprint_wechat(), url_prefix="/wechat")
app.register_blueprint(blueprint_v1(), url_prefix="/v1")
__author__ = 'gromero'

from application.modules.login import login_blueprint
from application.modules.account import account_blueprint
from application.modules.configuration import configuration_blueprint

from application import app, db, babel, p
from flask import url_for, redirect, render_template, request
from flask.ext.login import login_required
from flaskext.babel import refresh
import logging, urllib

app.register_blueprint(login_blueprint)
app.register_blueprint(account_blueprint)
app.register_blueprint(configuration_blueprint)

@app.route("/")
def index():
    return render_template('index.html')

@app.route("/app/<languaje>", endpoint='languaje_app')
@app.route("/app")
@login_required
def indexapp(languaje=None):
    if languaje:
        set_languaje(languaje)
    if request.args.get('next'):
        return redirect(urllib.unquote(request.args.get('next')))
    return render_template('index-app.html')

def set_languaje(languaje):
Exemple #13
0
# -*- coding: utf-8 -*-
from application import app
from controllers.login_register import login_page
from controllers.user_ui import user_page

# from flask_debugtoolbar import DebugToolbarExtension
# toolbar = DebugToolbarExtension( app )

'''
拦截器处理 和 错误处理器
'''
# from interceptors.Auth import *
from interceptors.errorHandler import *

app.register_blueprint(login_page, url_prefix="/")
app.register_blueprint(user_page, url_prefix="/user")

'''
模板函数
'''
from common.libs.UrlManager import UrlManager

app.add_template_global(UrlManager.buildStaticUrl, 'buildStaticUrl')
app.add_template_global(UrlManager.buildUrl, 'buildUrl')
Exemple #14
0
# -*- coding: utf8 -*-
# @author: yinan
# @time: 18-8-24 下午1:10
# @filename: web.py.py
from logging.config import dictConfig

from flask_cors import CORS
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop

from application import app, configs
from application.controllers.client_controller import client
from application.controllers.sys_admin_controller import admin

CORS(admin)
CORS(client)
app.register_blueprint(client, url_prefix='/')
app.register_blueprint(admin, url_prefix='/sysadmin')
dictConfig(configs.LOGGING_CONFIG)

http_server = HTTPServer(WSGIContainer(app))
http_server.listen(5000)
IOLoop.current().start()
Exemple #15
0
from web.controllers.user.User import router_user
from application import app

app.register_blueprint(router_user, url_prefix="/user")
Exemple #16
0
def setting_modules(app, modules):
    """ 注册Blueprint模块 """
    for module, url_prefix in modules:
        app.register_blueprint(module, url_prefix=url_prefix)
__author__ = 'mandrake'

from application import app
import config

# Importing routes
mods = [
    'rts_index',
    'rts_calendar',
    'rts_forum',
    'rts_github'
]

for mod in mods:
    q = __import__('routes.' + mod)
    m = getattr(q, mod)
    app.register_blueprint(m.routes, url_prefix=m.prefix)


#print app.url_map


if __name__ == '__main__':
    app.run(host=config.host, debug=config.debug)
Exemple #18
0
from web.controllers.index import route_index
from web.controllers.user.User import route_user
from application import app
from web.controllers.static import route_static
from web.controllers.account.Account import route_account
from web.controllers.member.Member import route_member
from web.controllers.api import route_api
from web.controllers.face.Face import route_face


'''
拦截器
'''
from web.interceptors.AuthInterceptor import *

'''
蓝图
'''
app.register_blueprint(route_index, url_prefix="/")
app.register_blueprint(route_user, url_prefix="/user")
app.register_blueprint(route_static, url_prefix="/static")
app.register_blueprint(route_account, url_prefix="/account")
app.register_blueprint(route_member, url_prefix="/member")
app.register_blueprint(route_face, url_prefix="/face")
Exemple #19
0
from application import app
from web.controllers.user.User import route_user
from web.controllers.index import route_index
from web.controllers.account.Account import route_account
from web.controllers.member.Member import route_member
from web.controllers.goods.Goods import route_goods
from web.controllers.upload.Upload import route_upload
# 拦截器的路由
from web.interceptos.AuthInterceptor import *


# 蓝图路由
app.register_blueprint(route_user, url_prefix="/user")
app.register_blueprint(route_index,url_prefix='/')
app.register_blueprint(route_account,url_prefix='/account')
app.register_blueprint(route_member,url_prefix='/member')
app.register_blueprint(route_goods,url_prefix='/goods')
app.register_blueprint(route_upload,url_prefix='/upload')
Exemple #20
0
# -*- coding: utf-8 -*-
from application import app
from indexController import index_page
from postController import post_page

app.register_blueprint(index_page, url_prefix="/wuqingvika")
app.register_blueprint(post_page, url_prefix="/post")
Exemple #21
0
from application import app

# 统一拦截器
from web.interceptors.AuthInterceptor import *
from web.interceptors.ErrorInterceptor import *

# 蓝图功能,对所有的url进行蓝图功能配置
from web.controllers.index import route_index
from web.controllers.account.Account import route_account
from web.controllers.finance.Finance import route_finance
from web.controllers.food.Food import route_food
from web.controllers.member.Member import route_member
from web.controllers.stat.Stat import route_stat
from web.controllers.user.User import route_user
from web.controllers.api import route_api
from web.controllers.upload.upload import route_upload

from web.controllers.static import route_static

app.register_blueprint(route_index, url_prefix='/')
app.register_blueprint(route_account, url_prefix='/account')
app.register_blueprint(route_finance, url_prefix='/finance')
app.register_blueprint(route_food, url_prefix='/food')
app.register_blueprint(route_member, url_prefix='/member')
app.register_blueprint(route_stat, url_prefix='/stat')
app.register_blueprint(route_user, url_prefix='/user')
app.register_blueprint(route_api, url_prefix='/api')
app.register_blueprint(route_upload, url_prefix='/upload')

app.register_blueprint(route_static, url_prefix='/static')
Exemple #22
0
from application import app
from web.controllers.user.User import router_user
from web.controllers.index import router_index

# 拦截器的路由
from web.interceptos.AuthInterceptor import *

# 蓝图路由
app.register_blueprint(router_user, url_prefix='/user')
app.register_blueprint(router_index, url_prefix="/")
Exemple #23
0
"""
统一拦截器
"""
from web.interceptors.AuthInterceptor import *
from web.interceptors.ErrorInterceptor import *
from web.interceptors.ApiAuthInterceptor import *
"""
蓝图功能,对所有的url进行蓝图功能配置
"""
from web.controllers.index import route_index
from web.controllers.user.User import route_user
from web.controllers.static import route_static
from web.controllers.account.Account import route_account
from web.controllers.finance.Finance import route_finance
from web.controllers.food.Food import route_food
from web.controllers.member.Member import route_member
from web.controllers.stat.Stat import route_stat
from web.controllers.api import route_api
from web.controllers.upload.Upload import route_upload

app.register_blueprint(route_index, url_prefix="/")
app.register_blueprint(route_user, url_prefix="/user")
app.register_blueprint(route_static, url_prefix="/static")
app.register_blueprint(route_account, url_prefix="/account")
app.register_blueprint(route_finance, url_prefix="/finance")
app.register_blueprint(route_food, url_prefix="/food")
app.register_blueprint(route_member, url_prefix="/member")
app.register_blueprint(route_stat, url_prefix="/stat")
app.register_blueprint(route_api, url_prefix="/api")
app.register_blueprint(route_upload, url_prefix="/upload")
Exemple #24
0
# _*_ coding:utf-8 _*_
__author__ = 'solin'
__date__ = '2019/9/22 10:48'
from application import app
from web.controllers.index import route_index
from web.controllers.user.User import route_user
from web.controllers.account.Account import route_account
from web.controllers.finance.Finance import route_finance
from web.controllers.food.Food import route_food
from web.controllers.member.Member import route_member
from web.controllers.stat.Stat import route_stat
from web.controllers.static import route_static
"""
拦截器
"""
from web.interceptors.AuthInterceptor import *
'''
HTTP模块相关初始化
进行蓝图功能的统一加载,所有url配置都在此
'''
app.register_blueprint(route_index, url_prefix="/")  # 管理后台入口
app.register_blueprint(route_user, url_prefix="/user")  # 管理后台用户信息相关
app.register_blueprint(route_account, url_prefix="/account")  # 管理后台账号相关
app.register_blueprint(route_finance, url_prefix="/finance")  # 管理后台财务相关
app.register_blueprint(route_food, url_prefix="/food")  # 管理后台美餐管理相关
app.register_blueprint(route_member, url_prefix="/member")  # 管理后台会员列表相关
app.register_blueprint(route_stat, url_prefix="/stat")  # 管理后台统计相关

app.register_blueprint(route_static, url_prefix="/static")  #静态文件
from application import app, render_template
import api as api

@app.route('/')
def hello_world():
    """ Function Comment """
    return render_template('index.html')

app.register_blueprint(api.task_api)
Exemple #26
0
# HTTP 模块相关初始化
"""
static interceptor
"""
from web.interceptors.AuthInterceptor import *

from application import app
from web.controllers.index import route_index
from web.controllers.compute.MockTransaction import route_mockTransaction
from web.controllers.static import route_static
from web.controllers.user.User import route_user

app.register_blueprint(route_mockTransaction, url_prefix='/mock')
app.register_blueprint(route_index, url_prefix='/')
app.register_blueprint(route_static, url_prefix='/static')
app.register_blueprint(route_user, url_prefix='/user')
Exemple #27
0
def register_blueprints():
    # 
    # Register the blueprints in the application
    # 
    app.register_blueprint(basic_http_blueprint, url_prefix='/labmanager')
    app.register_blueprint(lti_blueprint, url_prefix='/lti')
    app.register_blueprint(opensocial_blueprint, url_prefix='/os')
    app.register_blueprint(opensocial_blueprint, url_prefix='/opensocial')
    app.register_blueprint(repository_blueprint, url_prefix='/repo')
    app.register_blueprint(stats_blueprint, url_prefix='/stats')
    app.register_blueprint(repository_blueprint, url_prefix='/repository')
    app.register_blueprint(bookmarklet_blueprint, url_prefix='/bookmarklet')
    app.register_blueprint(embed_blueprint, url_prefix='/embed')
    app.register_blueprint(proxy_blueprint, url_prefix='/proxy')

    from labmanager.rlms.base import _BLUEPRINTS
    for url, blueprint in _BLUEPRINTS.items():
        app.register_blueprint(blueprint, url_prefix='/rlms' + url)
Exemple #28
0
from application import app
from web.controllers.goods.Goods import router_goods
from web.controllers.user.User import router_user
from web.controllers.index import route_index
from web.controllers.account.Account import router_account
from web.controllers.member.Member import router_member
from web.controllers.upload.Upload import router_upload
from web.controllers.static import route_static

# 拦截器路由
from web.interceptos.AuthInterceptor import *

# 蓝图路由
app.register_blueprint(route_index, url_prefix="/")
app.register_blueprint(router_user, url_prefix="/user")
app.register_blueprint(router_goods, url_prefix="/goods")
app.register_blueprint(router_account, url_prefix="/account")
app.register_blueprint(router_member, url_prefix="/member")
app.register_blueprint(router_upload, url_prefix="/upload")
app.register_blueprint(route_static, url_prefix="/static")