2020-01-26 20:14:27 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
2020-02-15 21:45:44 +00:00
|
|
|
|
|
|
|
if [ ! -f .env ]; then
|
|
|
|
echo "No .env found -- copying .example.env to .env!"
|
|
|
|
cp .env.example .env
|
|
|
|
fi
|
|
|
|
|
2020-02-15 22:19:36 +00:00
|
|
|
source .env
|
|
|
|
|
|
|
|
if [ $FEDIREADS_DATABASE_BACKEND = 'sqlite' ]; then
|
2020-02-19 02:27:03 +00:00
|
|
|
if [ -f fedireads.db ]; then
|
|
|
|
rm fedireads.db
|
|
|
|
fi
|
2020-02-15 22:19:36 +00:00
|
|
|
else
|
|
|
|
# assume postgres
|
|
|
|
dropdb fedireads
|
|
|
|
createdb fedireads
|
|
|
|
fi
|
|
|
|
|
2020-01-26 20:14:27 +00:00
|
|
|
python manage.py makemigrations fedireads
|
|
|
|
python manage.py migrate
|
|
|
|
|
2020-02-24 16:16:49 +00:00
|
|
|
python manage.py shell < init_db.py
|
2020-01-27 01:55:02 +00:00
|
|
|
python manage.py runserver
|