python - AUTH_USER_MODEL refers to model that has not been installed -
i getting error
improperlyconfigured @ /admin/ auth_user_model refers model 'ledger.user' has not been installed
i getting on production server. not when run things via localhost. first when making request. thought database must out of sync deleted tables , ran manage.py syncdb. now, seems have propogated , going admin throws error.
i have never seen error before , can't figure out deal is. have defined auth_user_model in settings.py:
... installed_apps = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'ledger', 'extension', 'plugin', 'social.apps.django_app.default', ) auth_user_model = 'ledger.user' ...
models.py:
... class user(abstractuser): def __unicode__(self): return self.username balance = models.integerfield(default=0) total_pledged = models.integerfield(default=0) last_pledged = models.foreignkey('transaction', related_name='pledger', blank=true, null=true) extension_key = models.charfield(max_length=100, null=true, blank=true) plugin_key = models.charfield(max_length=100, null=true, blank=true) ghosted = models.booleanfield(default=false) def save(self, *args, **kwargs): print('saving') try: self.company.save() except: print('no company') super(user, self).save(*args, **kwargs) ...
this error can appear if 1 of other apps fails load - if has nothing custom user model. in case, had 'gcharts' app installed needed install google-visualization-python library it. neither have user model, django returned error regardless.
the following should reveal true root cause of issue:
- comment out of apps in settings.py until django boots up.
- add apps 1 @ time until error
Comments
Post a Comment