I started learning Django some days ago and for practice I decided to make a little project.
After I did my model, I tried to map it to a relational model in sqlite3 using django.db. But after I run python manage.py makemigrations <app_name>
I get the following errors:
python manage.py makemigrations main
SystemCheckError: System check identified some issues:
ERRORS:
auth.Group_permissions: (fields.E336) The models is used as an intermediate models by '<django.db.models.fields.related.ManyToManyField: permissions>', but it does not have a foreign key to 'Group' or 'Permission'.
auth.User_groups: (fields.E336) The models is used as an intermediate models by '<django.db.models.fields.related.ManyToManyField: groups>', but it does not have a foreign key to 'User' or 'Group'.
auth.User_user_permissions: (fields.E336) The models is used as an intermediate models by '<django.db.models.fields.related.ManyToManyField: user_permissions>', but it does not have a foreign key to 'User' or 'Permission'.
contenttypes.ContentType: (models.E012) 'unique_together' refers to the nonexistent field 'models'.
I'm really confused about what they mean (at least they seem similar). In my model there are actually no ManyToMany relations, and I've never modified any of the classes listed in the error message (User, Group).
I don't know if my model's code is related to this. But I am suspicious about how I structured my project; I've left the models.py file empty and created a new directory "models" with all my model files inside. So:
<m_app>
├── migrations
│
├── sumbmodels
│ └── __init__.py <--- imports modelA, modelB, etc
| └── modelA.py
| └── modelB.py
| └── ...
|
├── static
│ └── <my_app>
|
├── templates
│ └── <my_app>
|
├── tests
│ └── __init__.py
| └── testA.py
| └── testB.py
| └── ...
│
└── models.py <--- from .submodels import *
│
└── ...
I'm sorry if this is not much information but given this error I have no idea where to look at.