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
This commit is contained in:
parent
41075bb3b5
commit
1dc860236f
|
@ -670,7 +670,7 @@ class QuestionnaireForm(BaseNomcomForm, forms.ModelForm):
|
|||
'js/SelectBox.js',
|
||||
'js/SelectFilter2.js',
|
||||
]
|
||||
admin_js = ['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in admin_js]
|
||||
admin_js = ['%sadmin/%s' % (settings.STATIC_URL, url) for url in admin_js]
|
||||
js = ["/js/jquery-1.5.1.min.js", "/js/nomcom.js"] + admin_js
|
||||
|
||||
|
||||
|
|
|
@ -84,16 +84,12 @@ SITE_ID = 1
|
|||
USE_I18N = False
|
||||
|
||||
# Absolute path to the directory that holds media.
|
||||
# Example: "/home/media/media.lawrence.com/"
|
||||
MEDIA_ROOT = BASE_DIR + "/../static/"
|
||||
|
||||
# URL that handles the media served from MEDIA_ROOT.
|
||||
MEDIA_URL = 'http://www.ietf.org/'
|
||||
|
||||
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
||||
# trailing slash.
|
||||
# Examples: "http://foo.com/media/", "/media/".
|
||||
ADMIN_MEDIA_PREFIX = '/media/'
|
||||
STATIC_URL = "/"
|
||||
|
||||
DAJAXICE_MEDIA_PREFIX = "dajaxice"
|
||||
|
||||
|
|
|
@ -69,6 +69,7 @@ urlpatterns = patterns('',
|
|||
if settings.SERVER_MODE in ('development', 'test'):
|
||||
urlpatterns += patterns('',
|
||||
(r'^(?P<path>(?:images|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
|
||||
(r'^(?P<path>admin/(?:img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
|
||||
(r'^(?P<path>secretariat/(img|css|js)/.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
|
||||
(r'^(?P<path>robots\.txt)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT+"dev/"}),
|
||||
(r'^_test500/$', lambda x: None),
|
||||
|
|
Loading…
Reference in a new issue