moved db file

This commit is contained in:
Elijah Lucian 2021-07-15 14:31:14 -06:00
parent 8e7fc05cd1
commit bf561613aa
4 changed files with 18 additions and 11 deletions

View File

@ -28,8 +28,9 @@ services:
server:
build:
context: ./server
# volumes:
# - ./server:/usr/src/server
volumes:
- ./server/server/settings.py:/usr/src/server/server/settings.py
- ./server/server/db:/usr/src/server/server/db
ports:
- 8000:8000
command: ["python", "manage.py", "runserver", "0.0.0.0:8000"]

View File

@ -1,6 +1,6 @@
from server.server.api.models import Transaction
from server.server.api.models import Transaction, Account, User, Stack
from django.core.management.base import BaseCommand
import random
class Command(BaseCommand):
help = "Seed database for dev"
@ -9,21 +9,27 @@ class Command(BaseCommand):
self.stdout.write('clearing and seeding database...')
User.objects.all().delete()
# create seed users
# - elijah / toffee15
# - toffee / toffee15
elijah = User(username="elijah",
email="elijah@westwinds.io",
password="toffee15")
ievgen = User(username="ievgen",
email="ievgen@westwinds.io",
password="toffee15")
tanner = User(username="tanner",
email="tanner@westwinds.io",
password="toffee15")
Account.objects.all().delete()
home = Account()
# create seed accounts
# Home Account
# $3000
# $3000
# - home expenses
Stack.objects.all().delete()
# create test stacks
# - name: shit
Transaction.objects.all().delete()
# generate transaction history
self.stdout.write('done!')
self.stdout.write('done!')

0
server/server/db/.keep Normal file
View File

View File

@ -96,7 +96,7 @@ WSGI_APPLICATION = 'server.wsgi.application'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
'NAME': BASE_DIR / 'server/db/db.sqlite3',
}
}