RPeraltaJr
6/16/2017 - 5:48 PM

Create a Model in an app and make migrations.

Create a Model in an app and make migrations.

from django.db import models

# Create your models here.
class Course(models.Model):
    created_at = models.DateTimeField(auto_now_add=True)
    title = models.CharField(max_length=255)
    description = models.TextField()

Make the migration for the COURSES app, after editing MODELS.PY

python manage.py makemigrations courses

Run Migrations for all apps

python manage.py migrate

Run Migrations for a single app

python manage.py migrate app_name