<commit_before>#!/bin/bash

python='env/bin/python'

mkdir -p logs
log_file=$(date "+%Y_%m_%d-%H_%M_%S")

echo '[-] Removing old database...'
rm -f db.sqlite3
if test -e "db.sqlite3"; then
    echo '[!] Database could not be deleted';
    exit;
fi

echo '[-] Applying Django migrations...'
$python manage.py migrate 2>&1 | tee logs/$log_file.log

echo '[-] Running test population scripts...'
$python populate_ruptureit.py 2>&1 | tee logs/$log_file.log

echo '[*] Backend has been deployed.'
$python manage.py runserver 2>&1 | tee logs/$log_file.log<commit_msg>Cleanup backend deployment script and add base directory variable<commit_after>#!/bin/bash

BASEDIR=$(dirname "$0")

mkdir -p $BASEDIR/logs
log_file=$(date "+%Y_%m_%d-%H_%M_%S")

echo '[*] Backend has been deployed.'
$BASEDIR/env/bin/python $BASEDIR/manage.py runserver 2>&1 | tee $BASEDIR/logs/$log_file.log
{'fraction_non_alphanumeric': 0.16915995397008055, 'fraction_numerical': 0.012658227848101266, 'mean_word_length': 4.54140127388535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2817909', 'n_tokens_mistral': 330, 'n_tokens_neox': 316, 'n_words': 84}