mirror of
https://github.com/django/django.git
synced 2025-07-30 08:35:23 +00:00
Fixed #22218 -- Deprecated django.conf.urls.patterns.
Thanks Carl Meyer for the suggestion and Alex Gaynor and Carl for reviews.
This commit is contained in:
parent
e6ced2bb08
commit
d73d0e071c
117 changed files with 1180 additions and 1099 deletions
|
@ -3,7 +3,7 @@ A second, custom AdminSite -- see tests.CustomAdminSiteTests.
|
|||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.conf.urls import patterns
|
||||
from django.conf.urls import url
|
||||
from django.contrib import admin
|
||||
from django.http import HttpResponse
|
||||
from django.contrib.auth.models import User
|
||||
|
@ -26,9 +26,9 @@ class Admin2(admin.AdminSite):
|
|||
return super(Admin2, self).index(request, {'foo': '*bar*'})
|
||||
|
||||
def get_urls(self):
|
||||
return patterns('',
|
||||
(r'^my_view/$', self.admin_view(self.my_view)),
|
||||
) + super(Admin2, self).get_urls()
|
||||
return [
|
||||
url(r'^my_view/$', self.admin_view(self.my_view)),
|
||||
] + super(Admin2, self).get_urls()
|
||||
|
||||
def my_view(self, request):
|
||||
return HttpResponse("Django is a magical pony!")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue