Answer the question
In order to leave comments, you need to log in
Error with custom user model on django 1.8?
an error occurred when migrating a project from django 1.6 to django 1.8
i have a custom user model
class Profile(AbstractUser):
middle_name = models.CharField(max_length=70, blank=True, verbose_name=_("Middle name"))
gender = models.CharField(max_length=2, choices=GENDER_CHOICES)
phone = models.CharField(max_length=150, blank=True, verbose_name=_("Phone"))
status = models.CharField(max_length=500, blank=True, verbose_name=_("Status"))
education = models.CharField(max_length=350, blank=True, verbose_name=_("Education"))
progress_display = models.BooleanField(default=True, blank=True, verbose_name=_("Display progress"))
about = models.TextField(blank=True, verbose_name=_("description about"))
city = models.CharField(max_length=75, blank=True, verbose_name=_("City"))
current_city = models.CharField(max_length=75, blank=True, verbose_name=_("Current city"))
birth = models.DateTimeField(blank=True, null=True, verbose_name=_("Birthday"))
registered = models.DateTimeField(auto_now=True, help_text=_('Registration date'),
verbose_name=_("registration date"))
is_teacher = models.BooleanField(default=False, blank=True, verbose_name=_("is_teacher"))
hide_fields = models.CharField(max_length=255, blank=True)
subscription = models.BooleanField(default=False, blank=True, verbose_name='Подписка на рассылку')
main_photo = models.ForeignKey('avatar.Photo', blank=True, verbose_name=_("user main-photo"), related_name='avatar', default=None, null=True)
class Meta:
verbose_name = _('User')
verbose_name_plural = _('Users')
ordering = ('-registered', 'id')
get_latest_by = 'registered'
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(BASE_DIR, 'applications'))
AUTH_USER_MODEL = 'profile.Profile'
INSTALLED_APPS = (
'social',
'photo',
'profile',
'qa',
'main',
'learn',
'donate',
'notifications',
'articles',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.contenttypes',
'grappelli',
'django_extensions',
'django.contrib.admin',
'rest_framework',
'djkombu',
'autofixture',
'crispy_forms'
)
Traceback (most recent call last):
File "/opt/pycharm-3.0.2/helpers/pycharm/django_manage.py", line 23, in <module>
run_module(manage_file, None, '__main__', True)
File "/usr/lib/python2.7/runpy.py", line 176, in run_module
fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/camaro/programming/imedrese/master/manage.py", line 14, in <module>
execute_from_command_line(sys.argv)
File "/home/camaro/programming/imedrese/master/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/home/camaro/programming/imedrese/master/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/camaro/programming/imedrese/master/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 190, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/home/camaro/programming/imedrese/master/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 41, in load_command_class
return module.Command()
File "/home/camaro/programming/imedrese/master/local/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 28, in __init__
self.UserModel = get_user_model()
File "/home/camaro/programming/imedrese/master/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 155, in get_user_model
"AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'profile.Profile' that has not been installed
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question