Enable /admin/ only on Django 0.96
- Legacy-Id: 1655
This commit is contained in:
parent
711240499f
commit
7893156023
12
ietf/urls.py
12
ietf/urls.py
|
@ -1,5 +1,6 @@
|
|||
# Copyright The IETF Trust 2007, 2009, All Rights Reserved
|
||||
|
||||
import django
|
||||
from django.conf.urls.defaults import patterns, include, handler404, handler500
|
||||
|
||||
from ietf.iesg.feeds import IESGAgenda
|
||||
|
@ -55,11 +56,6 @@ urlpatterns = patterns('',
|
|||
|
||||
(r'^$', 'ietf.redirects.views.redirect'),
|
||||
|
||||
# DJANGO_096: Comment out this line for Django 1.0 -- new admin
|
||||
# site works differently, and needs work
|
||||
# Uncomment this for admin:
|
||||
(r'^admin/', include('django.contrib.admin.urls')),
|
||||
|
||||
# Uncomment this for review pages:
|
||||
#(r'^review/$', 'ietf.utils.views.review'),
|
||||
#(r'^review/all/$', 'ietf.utils.views.all'),
|
||||
|
@ -80,6 +76,12 @@ urlpatterns = patterns('',
|
|||
(r'^accounts/(?P<dir>\w+)/', 'django.views.generic.simple.redirect_to', { 'url': '/account/%(dir)s/' }),
|
||||
)
|
||||
|
||||
# New admin site works differently, and needs work
|
||||
if django.VERSION[0] == 0:
|
||||
urlpatterns += patterns('',
|
||||
(r'^admin/', include('django.contrib.admin.urls')),
|
||||
)
|
||||
|
||||
if settings.SERVER_MODE in ('development', 'test'):
|
||||
urlpatterns += patterns('',
|
||||
(r'^(?P<path>(?:images|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
|
||||
|
|
Loading…
Reference in a new issue