Answer the question
In order to leave comments, you need to log in
How to create a new table in a database - Django?
New to django. Tell me, please, you need to make a new model in the application + tables in the database.
In model.py, I specified a new model class, with fields, etc.
The question itself: is it necessary to always execute makemigrations and then migrate?
How can I quickly announce a new table and model to django?
That is, the application already has other tables, and when you call migrate, it swears.
django.db.utils.ProgrammingError: relation " table " already exists
Answer the question
In order to leave comments, you need to log in
The question itself: is it necessary to always run makemigrations and then do migrate?
python manage.py makemigrations <app_name>
python manage.py migrate <app_name>
That is, the application already has other tables, and when you call migrate, it swears.
django.db.utils.ProgrammingError: relation "table" already exists
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question