Skip to content

Commit 1dc8602

Browse files
committed
Delete ADMIN_MEDIA_PREFIX which is now gone in Django, add a pattern to the static serving so a debug/test server serves the admin static files
- Legacy-Id: 6975
1 parent 41075bb commit 1dc8602

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

ietf/nomcom/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ class Media:
670670
'js/SelectBox.js',
671671
'js/SelectFilter2.js',
672672
]
673-
admin_js = ['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in admin_js]
673+
admin_js = ['%sadmin/%s' % (settings.STATIC_URL, url) for url in admin_js]
674674
js = ["/js/jquery-1.5.1.min.js", "/js/nomcom.js"] + admin_js
675675

676676

ietf/settings.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,12 @@
8484
USE_I18N = False
8585

8686
# Absolute path to the directory that holds media.
87-
# Example: "/home/media/media.lawrence.com/"
8887
MEDIA_ROOT = BASE_DIR + "/../static/"
8988

9089
# URL that handles the media served from MEDIA_ROOT.
9190
MEDIA_URL = 'http://www.ietf.org/'
9291

93-
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
94-
# trailing slash.
95-
# Examples: "http://foo.com/media/", "/media/".
96-
ADMIN_MEDIA_PREFIX = '/media/'
92+
STATIC_URL = "/"
9793

9894
DAJAXICE_MEDIA_PREFIX = "dajaxice"
9995

ietf/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
if settings.SERVER_MODE in ('development', 'test'):
7070
urlpatterns += patterns('',
7171
(r'^(?P<path>(?:images|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
72+
(r'^(?P<path>admin/(?:img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
7273
(r'^(?P<path>secretariat/(img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
7374
(r'^(?P<path>robots\.txt)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT+"dev/"}),
7475
(r'^_test500/$', lambda x: None),

0 commit comments

Comments
 (0)