Answer the question
In order to leave comments, you need to log in
What is the correct way to make changes to a django model?
I am new to python, django and programming in general. Essence of the question.
There is a model on the basis of which the database is made (i.e. migration, if I understand correctly how everything works).
The model looks like this:
class Order(models.Model):
data = models.DateField()
time = models.TimeField(null=True)
order_type = models.CharField(max_length=20)
name = models.CharField(max_length=60, null=True)
count = models.IntegerField(null=True)
comment = models.CharField(max_length=60, null=True)
Answer the question
In order to leave comments, you need to log in
1. Make any necessary changes to the model
2. Run python manage.py makemigrations
in the console
3. Locally or on a remote server (after migrating) run python manage.py migrate in the console
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question