Problem statement:
- I am trying to create a new model in a new file -
app1/models/model2.py
- I dont see any error when I try to makemigrations.
- But Django doesnt detect any changes.
- If I put the same code in my previous file
app1/models/model1.py
- makemigrations works. - I have tried -
python manage.py makemigrations app1
&python manage.py makemigrations
My basic model:
from django.db import models
class Xyz(models.Model):
name = models.CharField(max_length=100)
I tried through pycharm & normal terminal. I am using UBuntu 20.04LTS.
I deleted all migration files then reran makemigrations
for app1
, it only picked old changes. did not pick new Xyz
model.
So perhaps there is something wrong in the way I am creating this new model2.py file. But I am creating it normally like model1.py. I even tried to copy paste and rename the same file. All my folder have init.py in them.