<commit_before>#!/bin/bash

export DJANGO_SETTINGS_MODULE=ofm_helper.settings.prod

while getopts ":u:p:m:" opt; do
  case $opt in
    u)
	  USERNAME=$OPTARG
      ;;
    p)
	  PASSWORD=$OPTARG
      ;;
    m)
	  EMAIL=$OPTARG
      ;;
    \?)
      echo "Invalid option: -$OPTARG" >&2
      exit 1
      ;;
    :)
      echo "Option -$OPTARG requires an argument." >&2
      exit 1
      ;;
  esac
done

echo "from django.contrib.auth.models import User; User.objects.create_superuser('$USERNAME', '$EMAIL', '$PASSWORD')" \
    | python manage.py shell
python3 manage.py runserver 0.0.0.0:8000
<commit_msg>create admin user correctly on startup<commit_after>#!/bin/bash

export DJANGO_SETTINGS_MODULE=ofm_helper.settings.prod

while getopts ":u:p:m:" opt; do
  case $opt in
    u)
	  USERNAME=$OPTARG
      ;;
    p)
	  PASSWORD=$OPTARG
      ;;
    m)
	  EMAIL=$OPTARG
      ;;
    \?)
      echo "Invalid option: -$OPTARG" >&2
      exit 1
      ;;
    :)
      echo "Option -$OPTARG requires an argument." >&2
      exit 1
      ;;
  esac
done

echo "from users.models import OFMUser; OFMUser.objects.create(username='admin', password='<PASSWORD>', ofm_username='$USERNAME', email='$EMAIL', ofm_password='$PASSWORD')" \
    | python manage.py shell
python3 manage.py runserver 0.0.0.0:8000

{'fraction_non_alphanumeric': 0.13987635239567234, 'fraction_numerical': 0.02009273570324575, 'mean_word_length': 2.7, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6089106', 'n_tokens_mistral': 497, 'n_tokens_neox': 463, 'n_words': 107}