summaryrefslogtreecommitdiffstats
path: root/apps/urls.py
diff options
context:
space:
mode:
authorDirk Wallenstein <halsmit@t-online.de>2011-04-01 07:12:15 +0000
committerJeremy Kerr <jk@ozlabs.org>2011-04-14 13:05:29 +0800
commitc50379dda534564eb5701d8c007910bc1ee7e066 (patch)
treeb2b183387fb19e27b65eec53f91956f2665c39ef /apps/urls.py
parente84c31852aae3d1c79fe3cbb1aea2ca9646197ef (diff)
downloadpatchwork-c50379dda534564eb5701d8c007910bc1ee7e066.tar.bz2
patchwork-c50379dda534564eb5701d8c007910bc1ee7e066.tar.xz
admin: Streamline admin model registration
Use autodiscover and the new way to hook AdminSite into the URLconf. AdminSite.root() will be removed in Django-1.3 as noted here: http://docs.djangoproject.com/en/dev/internals/deprecation/ Signed-off-by: Dirk Wallenstein <halsmit@t-online.de> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/urls.py')
-rw-r--r--apps/urls.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/urls.py b/apps/urls.py
index 7ec5dd8..3894708 100644
--- a/apps/urls.py
+++ b/apps/urls.py
@@ -21,11 +21,13 @@ import os
from django.conf.urls.defaults import *
from django.conf import settings
-from patchwork.admin import admin_site
+from django.contrib import admin
from registration.views import register
from patchwork.forms import RegistrationForm
+admin.autodiscover()
+
htdocs = os.path.join(settings.ROOT_DIR, 'htdocs')
urlpatterns = patterns('',
@@ -40,7 +42,7 @@ urlpatterns = patterns('',
(r'^accounts/', include('registration.urls')),
# Uncomment this for admin:
- (r'^admin/(.*)', admin_site.root),
+ (r'^admin/', include(admin.site.urls)),
(r'^css/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': os.path.join(htdocs, 'css')}),