1👍
class Permission(models.Model):
def __unicode__(self):
return self.name
codename = models.CharField(max_length=50, blank=False)
name = models.CharField(max_length=50, blank=False)
class Meta:
db_table = 'auth_permission'
You expect your table to be named auth_permission
which is already being used by the Permission
model in the django.contrib.auth
app. This is why the error says:
django.db.utils.ProgrammingError: relation "auth_permission" already exists
Solution:
- Choose a different table name
- Do not specify the table name, then it will be in the form of
<app>_<modelclass>
- Another very bad idea would be to remove the
django.contrib.auth
fromINSTALLED_APPS
insettings.py
but then you risk breaking a lot of stuff and you probably really don’t want that.
Source:stackexchange.com