Answer the question
In order to leave comments, you need to log in
Nothing happens with the migration command, what's wrong?
I added a unicode function to the model on the hosting
class Profile(models.Model):
name = models.OneToOneField(User, verbose_name='Логин', on_delete=models.CASCADE)
avatar = models.ImageField(default='avatar.jpg', upload_to='kinomonster/media/avatars')
def __str__(self):
return f'{self.name.username}'
def unicode(self):
return u'%s' % (value)
./manage.py migrate
Answer the question
In order to leave comments, you need to log in
Well, - they added and added ... The structure of the model itself did not change. Why create migrations there ....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question