MCPcopy
hub / github.com/django/django / get_login_url

Method get_login_url

django/contrib/auth/middleware.py:61–69  ·  view source on GitHub ↗
(self, view_func)

Source from the content-addressed store, hash-verified

59 return self.handle_no_permission(request, view_func)
60
61 def get_login_url(self, view_func):
62 login_url = getattr(view_func, "login_url", None) or settings.LOGIN_URL
63 if not login_url:
64 raise ImproperlyConfigured(
65 "No login URL to redirect to. Define settings.LOGIN_URL or "
66 "provide a login_url via the 'django.contrib.auth.decorators."
67 "login_required' decorator."
68 )
69 return str(login_url)
70
71 def get_redirect_field_name(self, view_func):
72 return getattr(view_func, "redirect_field_name", self.redirect_field_name)

Callers 1

handle_no_permissionMethod · 0.95

Calls 1

Tested by

no test coverage detected