You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm probably doing something wrong here so apologies in advance!
I followed the installation and configuration steps in the documentation. It fails to assign permissions with the "ImproperlyConfigured: AUTH_USER_MODEL refers to model 'auth.User' that has not been installed".
I've read the related Django docs and understand that the AUTH_USER_MODEL setting uses the "app_label.UserModel" format when using a custom user model. I'm not using a custom user model but the default django one.
All issues and solutions I found in the internets were related to custom user models which I don't think applies to me.
I'm using django 1.6.1 and django-guardian 1.1.1.
I tried to set the settings.AUTH_USER_MODEL = 'guardian.User' to no avail.
Any help appreciated!
Cheers
These are the exact steps (after setting database config, I'm using here the default django permissions but I get the same result with permissions defined in the Meta class of the model)
from django.contrib.auth.models import User
john = User.objects.get(id=2)
john
<User: john>
from mtm.models import Sharing
obj = Sharing.objects.get(id=1)
obj
<Sharing: Sharing object>
john.has_perm('mtm.change_sharing', obj)
False
from guardian.shortcuts import assign_perm
assign_perm('mtm.change_sharing', john, obj)
Traceback (most recent call last):
File "<pyshell#21>", line 1, in
assign_perm('mtm.change_sharing', john, obj)
File "/usr/local/lib/python2.7/dist-packages/guardian/shortcuts.py", line 71, in assign_perm
user, group = get_identity(user_or_group)
File "/usr/local/lib/python2.7/dist-packages/guardian/utils.py", line 73, in get_identity
if isinstance(identity, get_user_model()):
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/init.py", line 129, in get_user_model
raise ImproperlyConfigured("AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL)
ImproperlyConfigured: AUTH_USER_MODEL refers to model 'auth.User' that has not been installed
The text was updated successfully, but these errors were encountered:
Fixed it by installing south and running manage.py migrate. I don't know if this is specific to my setup. If not you may want to update the config guide.
The most common reason for this error:
when you accidently mentioned your app name in MIDDLEWARE instead of INSTALLED_APPS, go in your settings.py file and check for this issue.
Hi,
I'm probably doing something wrong here so apologies in advance!
I followed the installation and configuration steps in the documentation. It fails to assign permissions with the "ImproperlyConfigured: AUTH_USER_MODEL refers to model 'auth.User' that has not been installed".
I've read the related Django docs and understand that the AUTH_USER_MODEL setting uses the "app_label.UserModel" format when using a custom user model. I'm not using a custom user model but the default django one.
All issues and solutions I found in the internets were related to custom user models which I don't think applies to me.
I'm using django 1.6.1 and django-guardian 1.1.1.
I tried to set the settings.AUTH_USER_MODEL = 'guardian.User' to no avail.
Any help appreciated!
Cheers
These are the exact steps (after setting database config, I'm using here the default django permissions but I get the same result with permissions defined in the Meta class of the model)
The text was updated successfully, but these errors were encountered: