当前位置: 首页>>代码示例>>Python>>正文


Python flask_sslify.SSLify方法代码示例

本文整理汇总了Python中flask_sslify.SSLify方法的典型用法代码示例。如果您正苦于以下问题:Python flask_sslify.SSLify方法的具体用法?Python flask_sslify.SSLify怎么用?Python flask_sslify.SSLify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在flask_sslify的用法示例。


在下文中一共展示了flask_sslify.SSLify方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app(config_object=ProdConfig):
    """An application factory, as explained here:
        http://flask.pocoo.org/docs/patterns/appfactories/

    :param config_object: The configuration object to use.
    """
    app = Flask(__name__)
    sslify = SSLify(app)

    # set config from the passed object
    app.config.from_object(config_object)
    # set additional config values from environ
    app.config['SLACK_WEBHOOK_URL'] = os.environ.get('SLACK_WEBHOOK_URL')

    register_extensions(app)
    register_blueprints(app)
    register_errorhandlers(app)
    register_template_globals(app)

    @app.before_first_request
    def before_first_request():
        register_logging(app)

    return app 
开发者ID:codeforamerica,项目名称:comport,代码行数:26,代码来源:app.py

示例2: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)

    bootstrap.init_app(app)
    mail.init_app(app)
    moment.init_app(app)
    db.init_app(app)
    login_manager.init_app(app)
    pagedown.init_app(app)

    if not app.debug and not app.testing and not app.config['SSL_DISABLE']:
        from flask_sslify import SSLify
        sslify = SSLify(app)

    from .main import main as main_blueprint
    app.register_blueprint(main_blueprint)

    from .auth import auth as auth_blueprint
    app.register_blueprint(auth_blueprint, url_prefix='/auth')

    return app 
开发者ID:KevDi,项目名称:Flashcards,代码行数:25,代码来源:__init__.py

示例3: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    db.init_app(app)

    if not app.debug and not app.testing and not app.config['SSL_DISABLE']:
        from flask_sslify import SSLify
        sslify = SSLify(app)

    from .main.views import main as main_blueprint
    app.register_blueprint(main_blueprint)

    from .main.api import api as api_blueprint
    app.register_blueprint(api_blueprint, url_prefix='/api')

    return app 
开发者ID:Blackyukun,项目名称:dingdian,代码行数:18,代码来源:__init__.py

示例4: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app(config_class=Config):
    app = Flask(__name__)
    app.config.from_object(Config)
    app.context_processor(inject_app_context)

    for _ext in _extensions:
        _ext.init_app(app)

    for _bp in _blueprints:
        app.register_blueprint(_bp)

    # only trigger SSLify if the app is running on Heroku
    if "DYNO" in os.environ:
        from flask_sslify import SSLify

        _ = SSLify(app)

    return app 
开发者ID:abs0lut3pwn4g3,项目名称:RTB-CTF-Framework,代码行数:20,代码来源:__init__.py

示例5: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app(config):
    app = Flask(__name__)
    app.config.from_object(config)
    config.init_app(app)
    db.init_app(app)
    login_manager.init_app(app)
    csrf.init_app(app)
    db.app = app

    if not app.debug and not app.testing and not app.config['SSL_DISABLE']:
        from flask_sslify import SSLify
        sslify = SSLify(app)

    from .main import main as main_blueprint
    app.register_blueprint(main_blueprint)

    return app 
开发者ID:Stasonis,项目名称:fitbit-api-example-python,代码行数:19,代码来源:__init__.py

示例6: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)

    bootstrap.init_app(app)
    mail.init_app(app)
    moment.init_app(app)
    db.init_app(app)
    login_manager.init_app(app)
    pagedown.init_app(app)

    if not app.debug and not app.testing and not app.config['SSL_DISABLE']:
        from flask_sslify import SSLify
        sslify = SSLify(app)

    from .main import main as main_blueprint
    app.register_blueprint(main_blueprint)

    from .auth import auth as auth_blueprint
    app.register_blueprint(auth_blueprint, url_prefix='/auth')

    from .api_1_0 import api as api_1_0_blueprint
    app.register_blueprint(api_1_0_blueprint, url_prefix='/api/v1.0')

    return app 
开发者ID:CircleCI-Public,项目名称:circleci-demo-python-flask,代码行数:28,代码来源:__init__.py

示例7: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    # config[config_name].init_app(app)
    moment.init_app(app)
    db.init_app(app)
    lm.init_app(app)
    mail.init_app(app)
    pagedown.init_app(app)
    whooshee.init_app(app)

    if not app.debug and not app.testing and not app.config['SSL_DISABLE']:
        from flask_sslify import SSLify
        sslify = SSLify(app)

    from .user import user as user_blueprint
    from .auth import auth as auth_blueprint
    from .admin import admin as admin_blueprint
    from .message import message as message_blueprint
    from .api_1_0 import api as api_1_0_blueprint

    app.register_blueprint(user_blueprint)
    app.register_blueprint(auth_blueprint, url_prefix='/auth')
    app.register_blueprint(admin_blueprint, url_prefix='/admin')
    app.register_blueprint(message_blueprint, url_prefix='/message')
    app.register_blueprint(api_1_0_blueprint, url_prefix='/api/v1.0')

    return app 
开发者ID:Blackyukun,项目名称:Simpleblog,代码行数:30,代码来源:__init__.py

示例8: init_https

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def init_https(app):
    # only trigger SSLify if the app is running on Heroku and debug is false
    if (app.config['DEBUG'] is False) and ('DYNO' in os.environ):
        from flask_sslify import SSLify
        SSLify(app) 
开发者ID:betterlife,项目名称:betterlifepsi,代码行数:7,代码来源:__init__.py

示例9: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)

    login_manager.init_app(app)

    # mail.init_app(app)

    # app.config["MAIL"] = mail

    scheduler.init_app(app)
    scheduler.start()

    # for blueprints
    from .blueprints import routes as routes_blueprint
    app.register_blueprint(routes_blueprint)

    from .api import api_bp as api_blueprint
    app.register_blueprint(api_blueprint, url_prefix='/api/v1')

    if app.config['SSL_REDIRECT']:
        from flask_sslify import SSLify
        sslify = SSLify(app)

    return app 
开发者ID:small99,项目名称:AutoLink,代码行数:28,代码来源:app.py

示例10: create_app

# 需要导入模块: import flask_sslify [as 别名]
# 或者: from flask_sslify import SSLify [as 别名]
def create_app():
    app = Flask(__name__)

    mail = Mail(app)
    if SSL:
        sslify = SSLify(app)

    from personal_mycroft_backend.utils import nice_json
    from personal_mycroft_backend.backend.decorators import noindex

    from personal_mycroft_backend.backend.auth import get_auth_routes
    from personal_mycroft_backend.backend.device import get_device_routes
    from personal_mycroft_backend.backend.stt import get_stt_routes
    from personal_mycroft_backend.backend.tts import get_tts_routes

    app = get_auth_routes(app)
    app = get_device_routes(app, mail)
    app = get_stt_routes(app)
    app = get_tts_routes(app)

    @app.route("/", methods=['GET'])
    @noindex
    def hello():
        return nice_json({
            "uri": "/",
            "welcome to Personal Mycroft Backend": {
                "author": "JarbasAI"
            }
        })

    return app 
开发者ID:MycroftAI,项目名称:personal-backend,代码行数:33,代码来源:__init__.py


注:本文中的flask_sslify.SSLify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。