當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。