<commit_before># -*- coding: utf-8 -*-
# Copyright (c) 2012 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
"""
    web
    ~~~~~~~~~~~~~~

    This package contains the web interface based on flask

    :copyright: (c) 2012 by AG DSN.
"""

from flask import Flask, redirect
from blueprints import finance, infrastructure, rights, user, housing
import template_filters

from pycroft.model.session import session


def make_app():
    """  Create and configure the main? Flask app object

    :return: The fully configured app object
    """
    app = Flask(__name__)

    #initialization code
    app.secret_key = r"eiNohfaefaig5Iek6oshai0eijuph4ohla6Eo1vi5bahnaeh3Bah7ohy1einuaxu"

    app.register_blueprint(user.bp, url_prefix="/user")
    app.register_blueprint(housing.bp, url_prefix="/housing")
    app.register_blueprint(infrastructure.bp, url_prefix="/infrastructure")
    app.register_blueprint(rights.bp, url_prefix="/rights")
    app.register_blueprint(finance.bp, url_prefix="/finance")

    template_filters.register_filters(app)

    @app.route('/')
    def redirect_to_index():
        return redirect('user')

    @app.teardown_request
    def shutdown_session(exception=None):
        session.remove()

    return app
<commit_msg>changed the redirected index-url to a dynamic url_for<commit_after># -*- coding: utf-8 -*-
# Copyright (c) 2012 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
"""
    web
    ~~~~~~~~~~~~~~

    This package contains the web interface based on flask

    :copyright: (c) 2012 by AG DSN.
"""

from flask import Flask, redirect, url_for
from blueprints import finance, infrastructure, rights, user, housing
import template_filters

from pycroft.model.session import session


def make_app():
    """  Create and configure the main? Flask app object

    :return: The fully configured app object
    """
    app = Flask(__name__)

    #initialization code
    app.secret_key = r"eiNohfaefaig5Iek6oshai0eijuph4ohla6Eo1vi5bahnaeh3Bah7ohy1einuaxu"

    app.register_blueprint(user.bp, url_prefix="/user")
    app.register_blueprint(housing.bp, url_prefix="/housing")
    app.register_blueprint(infrastructure.bp, url_prefix="/infrastructure")
    app.register_blueprint(rights.bp, url_prefix="/rights")
    app.register_blueprint(finance.bp, url_prefix="/finance")

    template_filters.register_filters(app)

    @app.route('/')
    def redirect_to_index():
        return redirect(url_for('user.overview'))

    @app.teardown_request
    def shutdown_session(exception=None):
        session.remove()

    return app

{'fraction_non_alphanumeric': 0.10461430081014442, 'fraction_numerical': 0.014793941528707291, 'mean_word_length': 4.0265486725663715, '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': '4962176', 'n_tokens_mistral': 912, 'n_tokens_neox': 856, 'n_words': 242}