Opened 15 years ago
Closed 15 years ago
#13381 closed (invalid)
admin:login doesn't work
Reported by: | alperkanat | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.2-beta |
Severity: | Keywords: | sites, named, url, pattern, namespace | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
it's absent in django.contrib.admin.sites.py:
def get_urls(self): from django.conf.urls.defaults import patterns, url, include if settings.DEBUG: self.check_dependencies() def wrap(view, cacheable=False): def wrapper(*args, **kwargs): return self.admin_view(view, cacheable)(*args, **kwargs) return update_wrapper(wrapper, view) # Admin-site-wide views. urlpatterns = patterns('', url(r'^$', wrap(self.index), name='index'), url(r'^logout/$', wrap(self.logout), name='logout'), url(r'^password_change/$', wrap(self.password_change, cacheable=True), name='password_change'), url(r'^password_change/done/$', wrap(self.password_change_done, cacheable=True), name='password_change_done'), url(r'^jsi18n/$', wrap(self.i18n_javascript, cacheable=True), name='jsi18n'), url(r'^r/(?P<content_type_id>\d+)/(?P<object_id>.+)/$', 'django.views.defaults.shortcut'), url(r'^(?P<app_label>\w+)/$', wrap(self.app_index), name='app_list') )
adding it works like a charm. attaching a patch..
Attachments (1)
Change History (2)
by , 15 years ago
Attachment: | login.patch added |
---|
comment:1 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
It's not a case of "doesn't work" - it's a case of "isn't needed". Admin doesn't require a /login url, and unless I'm mistaken, there isn't anywhere in documentation that suggests that it should be available. You just visit the url that you actually want, and the login process is handled as a decorator to that view.
Even if a login view were needed, the patch you provide doesn't work - or rather, it will log you in, but on success, it redirects you to the same login page. Again, the login mechanism for admin is different to the default auth.login process.
patch for adding login named url to be able to use it with namespaces