Во время миграции появляется следующая ошибка:
django.db.utils.ProgrammingError: отношения "users_user" не существует
File "/Users/user/Documents/workspace/api/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "/Users/user/Documents/workspace/api/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/Users/user/Documents/workspace/api/env/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/Users/user/Documents/workspace/api/env/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
return self.cursor.execute(sql)
Это моя модель:
from django.db import models
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from ..managers.user import UserManager
class User(AbstractBaseUser, PermissionsMixin):
# Email identifier, primary key, unique identifier for the user.
email = models.EmailField(verbose_name='email address', max_length=254, unique=True, db_index=True)
is_admin = models.BooleanField(default=False)
is_active = models.BooleanField(default=False)
objects = UserManager()
USERNAME_FIELD = 'email'
REQUIRED_FIELDS = []
class Meta:
verbose_name = 'User'
app_label = "users"
def __unicode__(self):
return self.email
@property
def get_full_name(self):
return self.email
@property
def get_short_name(self):
return self.email
def has_module_perms(self, app_label):
"""
Does the user have permissions to view the app `app_label`
"""
# Simplest possible answer: Yes, always
return True
@property
def is_staff(self):
# Simplest possible answer: All admins are staff
return self.is_admin
Настройки:
AUTH_USER_MODEL = 'users.User'
Все, что я пропустил?