forked from mirrors/bookwyrm
Create initial example db from a separate python file.
This commit is contained in:
parent
592c2b7dfd
commit
c1cf211d00
2 changed files with 11 additions and 8 deletions
10
init_db.py
Normal file
10
init_db.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
from fedireads.models import User
|
||||||
|
from fedireads.openlibrary import get_or_create_book
|
||||||
|
|
||||||
|
User.objects.create_user('mouse', 'mouse.reeve@gmail.com', 'password123')
|
||||||
|
User.objects.create_user('rat', 'rat@rat.com', 'ratword')
|
||||||
|
|
||||||
|
User.objects.get(id=1).followers.add(User.objects.get(id=2))
|
||||||
|
|
||||||
|
get_or_create_book('OL1715344W')
|
||||||
|
get_or_create_book('OL102749W')
|
|
@ -21,12 +21,5 @@ fi
|
||||||
python manage.py makemigrations fedireads
|
python manage.py makemigrations fedireads
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
|
|
||||||
echo "from fedireads.models import User
|
python manage.py shell < init_db.py
|
||||||
User.objects.create_user('mouse', 'mouse.reeve@gmail.com', 'password123')" | python manage.py shell
|
|
||||||
echo "from fedireads.models import User
|
|
||||||
User.objects.create_user('rat', 'rat@rat.com', 'ratword')
|
|
||||||
User.objects.get(id=1).followers.add(User.objects.get(id=2))" | python manage.py shell
|
|
||||||
echo "from fedireads.openlibrary import get_or_create_book
|
|
||||||
get_or_create_book('OL1715344W')
|
|
||||||
get_or_create_book('OL102749W')" | python manage.py shell
|
|
||||||
python manage.py runserver
|
python manage.py runserver
|
||||||
|
|
Loading…
Reference in a new issue