<commit_before>from flask import Flask
from flask.ext.security import Security
from .models import db, user_datastore
from .views import ratings
from .api import *

app = Flask(__name__)
app.config.from_object('config.DebugConfiguration')
db.init_app(app)
security = Security(app, user_datastore)
app.register_blueprint(ratings)<commit_msg>init the app database every time the app is started<commit_after>from flask import Flask
from flask.ext.security import Security
from .models import db, user_datastore
from .views import ratings
from .api import *

app = Flask(__name__)
app.config.from_object('config.DebugConfiguration')
db.init_app(app)
security = Security(app, user_datastore)
app.register_blueprint(ratings)


#TODO: remove the following init function, which destroys any existing app
#database and replaces it with default data
@app.before_first_request
def init_db():
    from .models import create_test_data
    db.drop_all()
    db.create_all()
    create_test_data()
{'fraction_non_alphanumeric': 0.07942973523421588, 'fraction_numerical': 0.0, 'mean_word_length': 5.922535211267606, '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': '5954750', 'n_tokens_mistral': 297, 'n_tokens_neox': 288, 'n_words': 92}