P
P
pit0nov2021-04-24 08:12:27
Django
pit0nov, 2021-04-24 08:12:27

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)

After that, I activated the virtual environment and migrated to putty.
./manage.py migrate
In response, I received nothing and there were no changes.
How to make a migration?
Thank you

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-04-24
@fox_12

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 question

Ask a Question

731 491 924 answers to any question