DEV Community

Joe
Joe

Posted on

Django Migrations: Turning Models Into Database Tables

Django migrations take your Python models and create real database tables.


1. Create Migrations

Run:

python manage.py makemigrations tracker
Enter fullscreen mode Exit fullscreen mode

2. Apply Migrations

Run:

python manage.py migrate
Enter fullscreen mode Exit fullscreen mode

3. What Just Happened?

  • The Category and Transaction tables are now in your database!
  • Django tracks changes for future updates.

Next: manage your data easily with Django admin.


Top comments (0)