2023-12-12
Created Dec. 12, 2023, 2:28 p.m.
Modified Dec. 13, 2023, 2:32 p.m.
Goal
Build out Django Models for our different apps (accounts
, bets
, fighters
, and fights
)
Notes
Yesterday I built out some of the Django Models for the Fighters App. I registered my current models to my fighters/admin.py
via the lines
from django.contrib import admin
from .models import Fighter, Cosmetic
# Register your models here.
admin.site.register(Fighter)
admin.site.register(Cosmetic)
Which made them accessible via the admin page.
I decided to try running this again with Docker and found that I needed to re-build my requirements.txt
file, then re-build the Docker Image using docker build .
. This still didn't work, so I found I needed to delete the Docker Image in the Docker Desktop App, then re-build it for it to work.
I had to re-run my Database Migrations via
docker-compose exec web python manage.py makemigrations
Results
- Established usable Django Models for the Fighters App that included cosmetics and fighter stats
- Added these models to the app
- Switched fighter stats to a JSON object type storage so that it only needs to access the db once to get all of the fighter's stats
Next Time
- Hook up media storage to S3 so that cosmetic / fighter images can be used