finding get_user_model

61 views
Skip to first unread message

Rasika

unread,
Jan 5, 2017, 11:30:01 PM1/5/17
to Django users
from django.contrib.auth import get_user_model
why I am not able to find the code forget_user_model in auth app.


def get_user_model(): """ Returns the User model that is active in this project. """ try: return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False) except ValueError: raise ImproperlyConfigured("AUTH_USER_MODEL must be of the form 'app_label.model_name'") except LookupError: raise ImproperlyConfigured( "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL )
Please help me.

Thank you

roboslone

unread,
Jan 6, 2017, 4:03:53 AM1/6/17
to django...@googlegroups.com
Hi! Did you run migrations after adding 'django.contrib.auth' to your INSTALLED_APPS?
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/25d99dff-e122-460e-9102-1e2a3331f737%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M Hashmi

unread,
Jan 6, 2017, 7:36:03 AM1/6/17
to django...@googlegroups.com
from django.apps.config import get_model

On Fri, Jan 6, 2017 at 2:03 AM, roboslone <robo...@gmail.com> wrote:
Hi! Did you run migrations after adding 'django.contrib.auth' to your INSTALLED_APPS?
On 6 Jan 2017, at 07:30, Rasika <rasikachi...@gmail.com> wrote:

from django.contrib.auth import get_user_model
why I am not able to find the code forget_user_model in auth app.


def get_user_model(): """ Returns the User model that is active in this project. """ try: return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False) except ValueError: raise ImproperlyConfigured("AUTH_USER_MODEL must be of the form 'app_label.model_name'") except LookupError: raise ImproperlyConfigured( "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL )
Please help me.

Thank you

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages