1
0
mirror of https://github.com/django/django.git synced 2025-09-15 05:29:11 +00:00

magic-removal: Moved django.views.auth.login.* to django.contrib.auth.views

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2496 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans 2006-03-07 02:06:28 +00:00
parent 345463ad8e
commit 0ec5a547c9
7 changed files with 8 additions and 8 deletions

View File

@ -1,9 +1,9 @@
from django.conf.urls.defaults import * from django.conf.urls.defaults import *
urlpatterns = patterns('', urlpatterns = patterns('',
(r'^login/$', 'django.views.auth.login.login'), (r'^login/$', 'django.contrib.auth.view.login'),
(r'^logout/$', 'django.views.auth.login.logout'), (r'^logout/$', 'django.contrib.auth.views.logout'),
(r'^login_another/$', 'django.views.auth.login.logout_then_login'), (r'^login_another/$', 'django.contrib.auth.views.logout_then_login'),
(r'^register/$', 'ellington.registration.views.registration.signup'), (r'^register/$', 'ellington.registration.views.registration.signup'),
(r'^register/(?P<challenge_string>\w{32})/$', 'ellington.registration.views.registration.register_form'), (r'^register/(?P<challenge_string>\w{32})/$', 'ellington.registration.views.registration.register_form'),

View File

@ -3,7 +3,7 @@ from django.conf.urls.defaults import *
urlpatterns = patterns('', urlpatterns = patterns('',
('^$', 'django.contrib.admin.views.main.index'), ('^$', 'django.contrib.admin.views.main.index'),
('^jsi18n/$', 'django.views.i18n.javascript_catalog', {'packages': 'django.conf'}), ('^jsi18n/$', 'django.views.i18n.javascript_catalog', {'packages': 'django.conf'}),
('^logout/$', 'django.views.auth.login.logout'), ('^logout/$', 'django.contrib.auth.views.logout'),
('^password_change/$', 'django.views.registration.passwords.password_change'), ('^password_change/$', 'django.views.registration.passwords.password_change'),
('^password_change/done/$', 'django.views.registration.passwords.password_change_done'), ('^password_change/done/$', 'django.views.registration.passwords.password_change_done'),
('^template_validator/$', 'django.contrib.admin.views.template.template_validator'), ('^template_validator/$', 'django.contrib.admin.views.template.template_validator'),

View File

@ -23,7 +23,7 @@ def flatpage(request, url):
# If registration is required for accessing this page, and the user isn't # If registration is required for accessing this page, and the user isn't
# logged in, redirect to the login page. # logged in, redirect to the login page.
if f.registration_required and request.user.is_anonymous(): if f.registration_required and request.user.is_anonymous():
from django.views.auth.login import redirect_to_login from django.contrib.auth.views import redirect_to_login
return redirect_to_login(request.path) return redirect_to_login(request.path)
if f.template_name: if f.template_name:
t = loader.select_template((f.template_name, DEFAULT_TEMPLATE)) t = loader.select_template((f.template_name, DEFAULT_TEMPLATE))

View File

@ -1,4 +1,4 @@
from django.views.auth import login from django.contrib.auth.views import redirect_to_login
def user_passes_test(test_func, login_url=login.LOGIN_URL): def user_passes_test(test_func, login_url=login.LOGIN_URL):
""" """
@ -10,7 +10,7 @@ def user_passes_test(test_func, login_url=login.LOGIN_URL):
def _checklogin(request, *args, **kwargs): def _checklogin(request, *args, **kwargs):
if test_func(request.user): if test_func(request.user):
return view_func(request, *args, **kwargs) return view_func(request, *args, **kwargs)
return login.redirect_to_login(request.path, login_url) return redirect_to_login(request.path, login_url)
return _checklogin return _checklogin
return _dec return _dec

View File

@ -2,7 +2,7 @@ from django.core.xheaders import populate_xheaders
from django.template import loader from django.template import loader
from django import forms from django import forms
from django.db.models import FileField from django.db.models import FileField
from django.views.auth.login import redirect_to_login from django.contrib.auth.views import redirect_to_login
from django.template import RequestContext from django.template import RequestContext
from django.core.paginator import ObjectPaginator, InvalidPage from django.core.paginator import ObjectPaginator, InvalidPage
from django.http import Http404, HttpResponse, HttpResponseRedirect from django.http import Http404, HttpResponse, HttpResponseRedirect