<commit_before># -*- coding:utf-8 -*-

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from config import config

db = SQLAlchemy()

def create_app(config_name):
    # initialize app
    app = Flask(__name__, instance_relative_config=True)

    # import config
    app.config.from_object(config[config_name])
    app.config.from_pyfile('config.py')

    # flask extensions initial
    db.init_app(app)

    # import blueprint
    from .admin import admin as admin_blueprint
    from .blog import blog as blog_blueprint

    # register blueprint
    app.register_blueprint(admin_blueprint,url_sufix='/admin')
    app.register_blueprint(blog_blueprint)

    return app<commit_msg>增加debugtoolbar<commit_after># -*- coding:utf-8 -*-

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_debugtoolbar import DebugToolbarExtension
from config import config

db = SQLAlchemy()
toolbar = DebugToolbarExtension()

def create_app(config_name):
    # initialize app
    app = Flask(__name__, instance_relative_config=True)

    # import config
    app.config.from_object(config[config_name])
    app.config.from_pyfile('config.py')

    # flask extensions initial
    db.init_app(app)
    toolbar.init_app(app)

    # import blueprint
    from .admin import admin as admin_blueprint
    from .blog import blog as blog_blueprint

    # register blueprint
    app.register_blueprint(admin_blueprint,url_prefix='/admin')
    app.register_blueprint(blog_blueprint)

    return app
{'fraction_non_alphanumeric': 0.07984031936127745, 'fraction_numerical': 0.0013306719893546241, 'mean_word_length': 4.1506849315068495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4080066', 'n_tokens_mistral': 471, 'n_tokens_neox': 449, 'n_words': 108}