1
1
Fork 0

Manage script - admin account init

master
Jan Kužílek 5 years ago
parent 725e8f5add
commit 2f8f7920f8

@ -29,6 +29,15 @@ prepare_db() {
$run flask db upgrade
}
prepare_accounts() {
$run flask shell << EOF
user = User(username='admin')
user.create_password('latexsucks')
db.session.add(user)
db.session.commit()
EOF
}
gunicorn_run() {
$run gunicorn yadc:app
}
@ -46,6 +55,9 @@ case $1 in
"init_db")
prepare_db
;;
"init_accounts")
prepare_accounts
;;
"init")
prepare_venv
prepare_instance
@ -55,13 +67,13 @@ case $1 in
edit_config
prepare_db
echo "Now (if no error occured) you are ready to launch your application using \'$0 run\'"
prepare_accounts
echo "Now (if no error occured) you are ready to launch your application using '$0 run'"
;;
"run")
gunicorn_run
;;
"")
*)
echo "useable parameters:"
echo " run - run gunicorn listener"
echo " init - complete init"
@ -69,5 +81,6 @@ case $1 in
echo " init_instance"
echo " config"
echo " init_db"
echo " init_accounts"
;;
esac
Loading…
Cancel
Save