1

i create models.py in accounts for the siteName model but i dont know how to fix error it.

how fix Django error column accounts_sitename.languageCode does not exist

ProgrammingError at /ar/admin/accounts/sitename/ column accounts_sitename.languageCode does not exist LINE 1: ...tename"."user_id", "accounts_sitename"."site_id", "accounts_... ^

class siteName(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    site = models.ForeignKey(Site, on_delete=models.CASCADE)
    languageCode = models.CharField( max_length=10, choices=LANGUAGES,unique=True )

    nameHome = models.CharField(max_length=111, blank=True)
    imageHome = models.ImageField( upload_to='site/' )
    bioHome = models.TextField(max_length=5500, blank=True)

    nameVideo = models.CharField(max_length=111, blank=True)
    imageVideo = models.ImageField( upload_to='site/' )
    bioVideo = models.TextField(max_length=5500, blank=True)

    nameForum = models.CharField(max_length=111, blank=True)
    imageForum = models.ImageField( upload_to='site/' )
    bioForum = models.TextField(max_length=5500, blank=True)
    def __str__(self):
        return self.nameHome
        
ProgrammingError at /ar/admin/accounts/sitename/
column accounts_sitename.languageCode does not exist
LINE 1: ...tename"."user_id", "accounts_sitename"."site_id", "accounts_...
                                                             ^
  • I can assume you get this error when you are opening your admin page. Did you do `makemigrations` and `migrate` operations? – Frendom Apr 11 '22 at 23:36
  • when do makemigrations and migrate show err django.db.utils.ProgrammingError: column "languageCode" of relation "accounts_sitename" does not exist – wwafklimtbnud Apr 11 '22 at 23:54
  • Have you tried [this solution](https://stackoverflow.com/a/46697898/12467282)? – crimsonpython24 Apr 12 '22 at 00:37

0 Answers0