Unable to create migration in django

About issue

  1. There is no migration folder
  2. Unable to create migration of model

Steps to replicate the issue

Created the project using this command: django-admin startproject practice1

I did not create any app using command: python manage.py startapp app_name

configured mysql in settings.py

DATABASES = {
    'default': {
        #'ENGINE': 'django.db.backends.sqlite3',
        "ENGINE": "django.db.backends.mysql",
        "NAME": "backend",
        "USER": "root",
        "PASSWORD": "",
        "HOST": "localhost",
        "PORT": "3306"
        #'NAME': BASE_DIR / 'db.sqlite3',
    }
}

Since there was no models.py file so I created it inside the directory where settings.py exists

models.py contents

from django.db import models

class Roles(models.Model):
    role = CharField(max_length=10)
    is_active = BooleanField(default=False)

now, in console, type python manage.py makemigrations

it says - No changes detected

Back to Top