In larger Django projects, the models.py file can become difficult to maintain.
A simple solution is to split models into multiple files while keeping them in the same app.
mysite
polls
models
__init__.py
models1.py
models2.py
- Remove models.py from the polls app
- Create a folder called models
- Inside the models folder create __init__.py(empty file)
- Create the required models for your project
python manage.py makemigrations
python manage.py migrate
Django