Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #16050 -- BACKWARDS-INCOMPATIBLE CHANGE: Moved static files of …

…the admin to conventional file system location.

This also removes the need for ADMIN_MEDIA_PREFIX and replaces it with the convention to find admin's static files at STATIC_URL + 'admin/'.

Thanks to Jacob for the review and general help.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16487 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 38a2444277a84eb6b74425f0e324d1dceb7d2ef1 1 parent 89e0e8b
@jezdez jezdez authored
Showing with 485 additions and 418 deletions.
  1. +4 −1 django/conf/__init__.py
  2. +0 −5 django/conf/global_settings.py
  3. +0 −5 django/conf/project_template/settings.py
  4. +2 −3 django/contrib/admin/helpers.py
  5. +14 −16 django/contrib/admin/options.py
  6. +32 −32 django/contrib/admin/{media → static/admin}/css/base.css
  7. +5 −5 django/contrib/admin/{media → static/admin}/css/changelists.css
  8. 0  django/contrib/admin/{media → static/admin}/css/dashboard.css
  9. +6 −6 django/contrib/admin/{media → static/admin}/css/forms.css
  10. +1 −1  django/contrib/admin/{media → static/admin}/css/ie.css
  11. 0  django/contrib/admin/{media → static/admin}/css/login.css
  12. +2 −2 django/contrib/admin/{media → static/admin}/css/rtl.css
  13. +20 −20 django/contrib/admin/{media → static/admin}/css/widgets.css
  14. 0  django/contrib/admin/{media/img/admin → static/admin/img}/arrow-down.gif
  15. 0  django/contrib/admin/{media/img/admin → static/admin/img}/arrow-up.gif
  16. 0  django/contrib/admin/{media/img/admin → static/admin/img}/changelist-bg.gif
  17. 0  django/contrib/admin/{media/img/admin → static/admin/img}/changelist-bg_rtl.gif
  18. 0  django/contrib/admin/{media/img/admin → static/admin/img}/chooser-bg.gif
  19. 0  django/contrib/admin/{media/img/admin → static/admin/img}/chooser_stacked-bg.gif
  20. 0  django/contrib/admin/{media/img/admin → static/admin/img}/default-bg-reverse.gif
  21. 0  django/contrib/admin/{media/img/admin → static/admin/img}/default-bg.gif
  22. 0  django/contrib/admin/{media/img/admin → static/admin/img}/deleted-overlay.gif
  23. 0  django/contrib/admin/{media → static/admin}/img/gis/move_vertex_off.png
  24. 0  django/contrib/admin/{media → static/admin}/img/gis/move_vertex_on.png
  25. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon-no.gif
  26. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon-unknown.gif
  27. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon-yes.gif
  28. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_addlink.gif
  29. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_alert.gif
  30. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_calendar.gif
  31. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_changelink.gif
  32. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_clock.gif
  33. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_cog.gif
  34. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_deletelink.gif
  35. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_error.gif
  36. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_searchbox.png
  37. 0  django/contrib/admin/{media/img/admin → static/admin/img}/icon_success.gif
  38. 0  django/contrib/admin/{media/img/admin → static/admin/img}/inline-delete-8bit.png
  39. 0  django/contrib/admin/{media/img/admin → static/admin/img}/inline-delete.png
  40. 0  django/contrib/admin/{media/img/admin → static/admin/img}/inline-restore-8bit.png
  41. 0  django/contrib/admin/{media/img/admin → static/admin/img}/inline-restore.png
  42. 0  django/contrib/admin/{media/img/admin → static/admin/img}/inline-splitter-bg.gif
  43. 0  django/contrib/admin/{media/img/admin → static/admin/img}/nav-bg-grabber.gif
  44. 0  django/contrib/admin/{media/img/admin → static/admin/img}/nav-bg-reverse.gif
  45. 0  django/contrib/admin/{media/img/admin → static/admin/img}/nav-bg-selected.gif
  46. 0  django/contrib/admin/{media/img/admin → static/admin/img}/nav-bg.gif
  47. 0  django/contrib/admin/{media/img/admin → static/admin/img}/selector-add.gif
  48. 0  django/contrib/admin/{media/img/admin → static/admin/img}/selector-addall.gif
  49. 0  django/contrib/admin/{media/img/admin → static/admin/img}/selector-remove.gif
  50. 0  django/contrib/admin/{media/img/admin → static/admin/img}/selector-removeall.gif
  51. 0  django/contrib/admin/{media/img/admin → static/admin/img}/selector-search.gif
  52. 0  django/contrib/admin/{media/img/admin → static/admin/img}/selector_stacked-add.gif
  53. 0  django/contrib/admin/{media/img/admin → static/admin/img}/selector_stacked-remove.gif
  54. 0  django/contrib/admin/{media/img/admin → static/admin/img}/tool-left.gif
  55. 0  django/contrib/admin/{media/img/admin → static/admin/img}/tool-left_over.gif
  56. 0  django/contrib/admin/{media/img/admin → static/admin/img}/tool-right.gif
  57. 0  django/contrib/admin/{media/img/admin → static/admin/img}/tool-right_over.gif
  58. 0  django/contrib/admin/{media/img/admin → static/admin/img}/tooltag-add.gif
  59. 0  django/contrib/admin/{media/img/admin → static/admin/img}/tooltag-add_over.gif
  60. 0  django/contrib/admin/{media/img/admin → static/admin/img}/tooltag-arrowright.gif
  61. 0  django/contrib/admin/{media/img/admin → static/admin/img}/tooltag-arrowright_over.gif
  62. 0  django/contrib/admin/{media → static/admin}/js/LICENSE-JQUERY.txt
  63. 0  django/contrib/admin/{media → static/admin}/js/SelectBox.js
  64. +2 −2 django/contrib/admin/{media → static/admin}/js/SelectFilter2.js
  65. 0  django/contrib/admin/{media → static/admin}/js/actions.js
  66. 0  django/contrib/admin/{media → static/admin}/js/actions.min.js
  67. +2 −2 django/contrib/admin/{media → static/admin}/js/admin/DateTimeShortcuts.js
  68. 0  django/contrib/admin/{media → static/admin}/js/admin/RelatedObjectLookups.js
  69. 0  django/contrib/admin/{media → static/admin}/js/admin/ordering.js
  70. 0  django/contrib/admin/{media → static/admin}/js/calendar.js
  71. 0  django/contrib/admin/{media → static/admin}/js/collapse.js
  72. 0  django/contrib/admin/{media → static/admin}/js/collapse.min.js
  73. 0  django/contrib/admin/{media → static/admin}/js/compress.py
  74. 0  django/contrib/admin/{media → static/admin}/js/core.js
  75. 0  django/contrib/admin/{media → static/admin}/js/getElementsBySelector.js
  76. 0  django/contrib/admin/{media → static/admin}/js/inlines.js
  77. 0  django/contrib/admin/{media → static/admin}/js/inlines.min.js
  78. 0  django/contrib/admin/{media → static/admin}/js/jquery.init.js
  79. 0  django/contrib/admin/{media → static/admin}/js/jquery.js
  80. 0  django/contrib/admin/{media → static/admin}/js/jquery.min.js
  81. 0  django/contrib/admin/{media → static/admin}/js/prepopulate.js
  82. 0  django/contrib/admin/{media → static/admin}/js/prepopulate.min.js
  83. 0  django/contrib/admin/{media → static/admin}/js/timeparse.js
  84. 0  django/contrib/admin/{media → static/admin}/js/urlify.js
  85. +2 −2 django/contrib/admin/templates/admin/auth/user/change_password.html
  86. +5 −5 django/contrib/admin/templates/admin/base.html
  87. +2 −2 django/contrib/admin/templates/admin/change_form.html
  88. +3 −3 django/contrib/admin/templates/admin/change_list.html
  89. +2 −3 django/contrib/admin/templates/admin/change_list_results.html
  90. +3 −3 django/contrib/admin/templates/admin/edit_inline/stacked.html
  91. +3 −3 django/contrib/admin/templates/admin/edit_inline/tabular.html
  92. +2 −2 django/contrib/admin/templates/admin/index.html
  93. +2 −2 django/contrib/admin/templates/admin/login.html
  94. +2 −3 django/contrib/admin/templates/admin/search_form.html
  95. +2 −2 django/contrib/admin/templates/registration/password_change_form.html
  96. +4 −3 django/contrib/admin/templatetags/admin_list.py
  97. +4 −0 django/contrib/admin/templatetags/adminmedia.py
  98. +17 −17 django/contrib/admin/widgets.py
  99. +6 −5 django/contrib/gis/admin/widgets.py
  100. +3 −2 django/contrib/gis/templates/gis/admin/openlayers.html
  101. +1 −8 django/contrib/staticfiles/storage.py
  102. +5 −8 django/core/servers/basehttp.py
  103. +19 −1 django/templatetags/static.py
  104. +22 −6 docs/howto/static-files.txt
  105. +5 −0 docs/internals/deprecation.txt
  106. +13 −32 docs/ref/contrib/staticfiles.txt
  107. +0 −14 docs/ref/settings.txt
  108. +2 −0  docs/ref/templates/api.txt
  109. +152 −87 docs/ref/templates/builtins.txt
  110. +36 −0 docs/releases/1.4.txt
  111. +1 −1  tests/regressiontests/admin_util/tests.py
  112. +11 −8 tests/regressiontests/admin_widgets/tests.py
  113. +15 −24 tests/regressiontests/forms/tests/media.py
  114. +14 −13 tests/regressiontests/servers/tests.py
  115. +0 −1  tests/regressiontests/staticfiles_tests/project/site_media/static/test/storage.txt
  116. +32 −58 tests/regressiontests/staticfiles_tests/tests.py
  117. +3 −0  tests/regressiontests/templates/tests.py
  118. +2 −0  tests/runtests.py
View
5 django/conf/__init__.py
@@ -68,8 +68,11 @@ class BaseSettings(object):
"""
def __setattr__(self, name, value):
if name in ("MEDIA_URL", "STATIC_URL") and value and not value.endswith('/'):
- warnings.warn('If set, %s must end with a slash' % name,
+ warnings.warn("If set, %s must end with a slash" % name,
DeprecationWarning)
+ elif name == "ADMIN_MEDIA_PREFIX":
+ warnings.warn("The ADMIN_MEDIA_PREFIX setting has been removed; "
+ "use STATIC_URL instead.", DeprecationWarning)
object.__setattr__(self, name, value)
View
5 django/conf/global_settings.py
@@ -593,8 +593,3 @@
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
-
-# URL prefix for admin media -- CSS, JavaScript and images.
-# Make sure to use a trailing slash.
-# Examples: "http://foo.com/static/admin/", "/static/admin/".
-ADMIN_MEDIA_PREFIX = '/static/admin/'
View
5 django/conf/project_template/settings.py
@@ -62,11 +62,6 @@
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static/'
-# URL prefix for admin static files -- CSS, JavaScript and images.
-# Make sure to use a trailing slash.
-# Examples: "http://foo.com/static/admin/", "/static/admin/".
-ADMIN_MEDIA_PREFIX = '/static/admin/'
-
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
View
5 django/contrib/admin/helpers.py
@@ -1,5 +1,4 @@
from django import forms
-from django.conf import settings
from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.contenttypes.models import ContentType
@@ -75,8 +74,8 @@ def __init__(self, form, name=None, readonly_fields=(), fields=(), classes=(),
def _media(self):
if 'collapse' in self.classes:
- js = ['js/jquery.min.js', 'js/jquery.init.js', 'js/collapse.min.js']
- return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
+ js = ['jquery.min.js', 'jquery.init.js', 'collapse.min.js']
+ return forms.Media(js=['admin/js/%s' % url for url in js])
return forms.Media()
media = property(_media)
View
30 django/contrib/admin/options.py
@@ -349,19 +349,19 @@ def urls(self):
urls = property(urls)
def _media(self):
- from django.conf import settings
-
- js = ['js/core.js', 'js/admin/RelatedObjectLookups.js',
- 'js/jquery.min.js', 'js/jquery.init.js']
+ js = [
+ 'core.js',
+ 'admin/RelatedObjectLookups.js',
+ 'jquery.min.js',
+ 'jquery.init.js'
+ ]
if self.actions is not None:
- js.extend(['js/actions.min.js'])
+ js.append('actions.min.js')
if self.prepopulated_fields:
- js.append('js/urlify.js')
- js.append('js/prepopulate.min.js')
+ js.extend(['urlify.js', 'prepopulate.min.js'])
if self.opts.get_ordered_objects():
- js.extend(['js/getElementsBySelector.js', 'js/dom-drag.js' , 'js/admin/ordering.js'])
-
- return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
+ js.extend(['getElementsBySelector.js', 'dom-drag.js' , 'admin/ordering.js'])
+ return forms.Media(js=['admin/js/%s' % url for url in js])
media = property(_media)
def has_add_permission(self, request):
@@ -1321,14 +1321,12 @@ def __init__(self, parent_model, admin_site):
self.verbose_name_plural = self.model._meta.verbose_name_plural
def _media(self):
- from django.conf import settings
- js = ['js/jquery.min.js', 'js/jquery.init.js', 'js/inlines.min.js']
+ js = ['jquery.min.js', 'jquery.init.js', 'inlines.min.js']
if self.prepopulated_fields:
- js.append('js/urlify.js')
- js.append('js/prepopulate.min.js')
+ js.extend(['urlify.js, prepopulate.min.js'])
if self.filter_vertical or self.filter_horizontal:
- js.extend(['js/SelectBox.js' , 'js/SelectFilter2.js'])
- return forms.Media(js=['%s%s' % (settings.ADMIN_MEDIA_PREFIX, url) for url in js])
+ js.extend(['SelectBox.js', 'SelectFilter2.js'])
+ return forms.Media(js=['admin/js/%s' % url for url in js])
media = property(_media)
def get_formset(self, request, obj=None, **kwargs):
View
64 django/contrib/admin/media/css/base.css → ...o/contrib/admin/static/admin/css/base.css
@@ -259,7 +259,7 @@ tfoot td {
color: #666;
padding: 2px 5px;
font-size: 11px;
- background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
+ background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
border-left: 1px solid #ddd;
border-bottom: 1px solid #ddd;
}
@@ -311,7 +311,7 @@ thead th a:link, thead th a:visited {
}
thead th.sorted {
- background: #c5c5c5 url(../img/admin/nav-bg-selected.gif) top left repeat-x;
+ background: #c5c5c5 url(../img/nav-bg-selected.gif) top left repeat-x;
}
table thead th.sorted a {
@@ -319,11 +319,11 @@ table thead th.sorted a {
}
table thead th.ascending a {
- background: url(../img/admin/arrow-up.gif) right .4em no-repeat;
+ background: url(../img/arrow-up.gif) right .4em no-repeat;
}
table thead th.descending a {
- background: url(../img/admin/arrow-down.gif) right .4em no-repeat;
+ background: url(../img/arrow-down.gif) right .4em no-repeat;
}
table thead th.sorted a span.text {
@@ -368,7 +368,7 @@ table thead th.sorted a span.clear {
#sorting-popup-div .cancel {
font-size: 10px;
- background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x;
+ background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x;
border-top: 1px solid #ddd;
text-align: center;
}
@@ -386,7 +386,7 @@ table.orderable tbody tr td:hover {
table.orderable tbody tr td:first-child {
padding-left: 14px;
- background-image: url(../img/admin/nav-bg-grabber.gif);
+ background-image: url(../img/nav-bg-grabber.gif);
background-repeat: repeat-y;
}
@@ -416,7 +416,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
/* FORM BUTTONS */
.button, input[type=submit], input[type=button], .submit-row input {
- background: white url(../img/admin/nav-bg.gif) bottom repeat-x;
+ background: white url(../img/nav-bg.gif) bottom repeat-x;
padding: 3px 5px;
color: black;
border: 1px solid #bbb;
@@ -424,31 +424,31 @@ input[type=text], input[type=password], textarea, select, .vTextField {
}
.button:active, input[type=submit]:active, input[type=button]:active {
- background-image: url(../img/admin/nav-bg-reverse.gif);
+ background-image: url(../img/nav-bg-reverse.gif);
background-position: top;
}
.button[disabled], input[type=submit][disabled], input[type=button][disabled] {
- background-image: url(../img/admin/nav-bg.gif);
+ background-image: url(../img/nav-bg.gif);
background-position: bottom;
opacity: 0.4;
}
.button.default, input[type=submit].default, .submit-row input.default {
border: 2px solid #5b80b2;
- background: #7CA0C7 url(../img/admin/default-bg.gif) bottom repeat-x;
+ background: #7CA0C7 url(../img/default-bg.gif) bottom repeat-x;
font-weight: bold;
color: white;
float: right;
}
.button.default:active, input[type=submit].default:active {
- background-image: url(../img/admin/default-bg-reverse.gif);
+ background-image: url(../img/default-bg-reverse.gif);
background-position: top;
}
.button[disabled].default, input[type=submit][disabled].default, input[type=button][disabled].default {
- background-image: url(../img/admin/default-bg.gif);
+ background-image: url(../img/default-bg.gif);
background-position: bottom;
opacity: 0.4;
}
@@ -485,7 +485,7 @@ input[type=text], input[type=password], textarea, select, .vTextField {
font-size: 11px;
text-align: left;
font-weight: bold;
- background: #7CA0C7 url(../img/admin/default-bg.gif) top left repeat-x;
+ background: #7CA0C7 url(../img/default-bg.gif) top left repeat-x;
color: white;
}
@@ -507,15 +507,15 @@ ul.messagelist li {
margin: 0 0 3px 0;
border-bottom: 1px solid #ddd;
color: #666;
- background: #ffc url(../img/admin/icon_success.gif) 5px .3em no-repeat;
+ background: #ffc url(../img/icon_success.gif) 5px .3em no-repeat;
}
ul.messagelist li.warning{
- background-image: url(../img/admin/icon_alert.gif);
+ background-image: url(../img/icon_alert.gif);
}
ul.messagelist li.error{
- background-image: url(../img/admin/icon_error.gif);
+ background-image: url(../img/icon_error.gif);
}
.errornote {
@@ -525,7 +525,7 @@ ul.messagelist li.error{
margin: 0 0 3px 0;
border: 1px solid red;
color: red;
- background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat;
+ background: #ffc url(../img/icon_error.gif) 5px .3em no-repeat;
}
ul.errorlist {
@@ -540,7 +540,7 @@ ul.errorlist {
margin: 0 0 3px 0;
border: 1px solid red;
color: white;
- background: red url(../img/admin/icon_alert.gif) 5px .3em no-repeat;
+ background: red url(../img/icon_alert.gif) 5px .3em no-repeat;
}
.errorlist li a {
@@ -576,7 +576,7 @@ div.system-message p.system-message-title {
padding: 4px 5px 4px 25px;
margin: 0;
color: red;
- background: #ffc url(../img/admin/icon_error.gif) 5px .3em no-repeat;
+ background: #ffc url(../img/icon_error.gif) 5px .3em no-repeat;
}
.description {
@@ -587,7 +587,7 @@ div.system-message p.system-message-title {
/* BREADCRUMBS */
div.breadcrumbs {
- background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x;
+ background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
padding: 2px 8px 3px 8px;
font-size: 11px;
color: #999;
@@ -600,17 +600,17 @@ div.breadcrumbs {
.addlink {
padding-left: 12px;
- background: url(../img/admin/icon_addlink.gif) 0 .2em no-repeat;
+ background: url(../img/icon_addlink.gif) 0 .2em no-repeat;
}
.changelink {
padding-left: 12px;
- background: url(../img/admin/icon_changelink.gif) 0 .2em no-repeat;
+ background: url(../img/icon_changelink.gif) 0 .2em no-repeat;
}
.deletelink {
padding-left: 12px;
- background: url(../img/admin/icon_deletelink.gif) 0 .25em no-repeat;
+ background: url(../img/icon_deletelink.gif) 0 .25em no-repeat;
}
a.deletelink:link, a.deletelink:visited {
@@ -645,14 +645,14 @@ a.deletelink:hover {
.object-tools li {
display: block;
float: left;
- background: url(../img/admin/tool-left.gif) 0 0 no-repeat;
+ background: url(../img/tool-left.gif) 0 0 no-repeat;
padding: 0 0 0 8px;
margin-left: 2px;
height: 16px;
}
.object-tools li:hover {
- background: url(../img/admin/tool-left_over.gif) 0 0 no-repeat;
+ background: url(../img/tool-left_over.gif) 0 0 no-repeat;
}
.object-tools a:link, .object-tools a:visited {
@@ -661,29 +661,29 @@ a.deletelink:hover {
color: white;
padding: .1em 14px .1em 8px;
height: 14px;
- background: #999 url(../img/admin/tool-right.gif) 100% 0 no-repeat;
+ background: #999 url(../img/tool-right.gif) 100% 0 no-repeat;
}
.object-tools a:hover, .object-tools li:hover a {
- background: #5b80b2 url(../img/admin/tool-right_over.gif) 100% 0 no-repeat;
+ background: #5b80b2 url(../img/tool-right_over.gif) 100% 0 no-repeat;
}
.object-tools a.viewsitelink, .object-tools a.golink {
- background: #999 url(../img/admin/tooltag-arrowright.gif) top right no-repeat;
+ background: #999 url(../img/tooltag-arrowright.gif) top right no-repeat;
padding-right: 28px;
}
.object-tools a.viewsitelink:hover, .object-tools a.golink:hover {
- background: #5b80b2 url(../img/admin/tooltag-arrowright_over.gif) top right no-repeat;
+ background: #5b80b2 url(../img/tooltag-arrowright_over.gif) top right no-repeat;
}
.object-tools a.addlink {
- background: #999 url(../img/admin/tooltag-add.gif) top right no-repeat;
+ background: #999 url(../img/tooltag-add.gif) top right no-repeat;
padding-right: 28px;
}
.object-tools a.addlink:hover {
- background: #5b80b2 url(../img/admin/tooltag-add_over.gif) top right no-repeat;
+ background: #5b80b2 url(../img/tooltag-add_over.gif) top right no-repeat;
}
/* OBJECT HISTORY */
@@ -818,7 +818,7 @@ table#change-history tbody th {
}
#content-related .module h2 {
- background: #eee url(../img/admin/nav-bg.gif) bottom left repeat-x;
+ background: #eee url(../img/nav-bg.gif) bottom left repeat-x;
color: #666;
}
View
10 ...o/contrib/admin/media/css/changelists.css → ...ib/admin/static/admin/css/changelists.css
@@ -20,7 +20,7 @@
}
.change-list .filtered {
- background: white url(../img/admin/changelist-bg.gif) top right repeat-y !important;
+ background: white url(../img/changelist-bg.gif) top right repeat-y !important;
}
.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull {
@@ -40,7 +40,7 @@
color: #666;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
- background: white url(../img/admin/nav-bg.gif) 0 180% repeat-x;
+ background: white url(../img/nav-bg.gif) 0 180% repeat-x;
overflow: hidden;
}
@@ -82,7 +82,7 @@
#changelist #toolbar {
padding: 3px;
border-bottom: 1px solid #ddd;
- background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
+ background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
color: #666;
}
@@ -156,7 +156,7 @@
.change-list ul.toplinks {
display: block;
- background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x;
+ background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
border-top: 1px solid white;
float: left;
padding: 0 !important;
@@ -246,7 +246,7 @@
padding: 3px;
border-top: 1px solid #fff;
border-bottom: 1px solid #ddd;
- background: white url(../img/admin/nav-bg-reverse.gif) 0 -10px repeat-x;
+ background: white url(../img/nav-bg-reverse.gif) 0 -10px repeat-x;
}
#changelist .actions.selected {
View
0  django/contrib/admin/media/css/dashboard.css → ...trib/admin/static/admin/css/dashboard.css
File renamed without changes
View
12 django/contrib/admin/media/css/forms.css → .../contrib/admin/static/admin/css/forms.css
@@ -140,7 +140,7 @@ fieldset.collapsed h2, fieldset.collapsed {
}
fieldset.collapsed h2 {
- background-image: url(../img/admin/nav-bg.gif);
+ background-image: url(../img/nav-bg.gif);
background-position: bottom left;
color: #999;
}
@@ -161,7 +161,7 @@ fieldset.monospace textarea {
.submit-row {
padding: 5px 7px;
text-align: right;
- background: white url(../img/admin/nav-bg.gif) 0 100% repeat-x;
+ background: white url(../img/nav-bg.gif) 0 100% repeat-x;
border: 1px solid #ccc;
margin: 5px 0;
overflow: hidden;
@@ -184,7 +184,7 @@ body.popup .submit-row {
}
.submit-row .deletelink {
- background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat;
+ background: url(../img/icon_deletelink.gif) 0 50% no-repeat;
padding-left: 14px;
}
@@ -251,7 +251,7 @@ body.popup .submit-row {
color: #666;
padding: 3px 5px;
font-size: 11px;
- background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
+ background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
border-bottom: 1px solid #ddd;
}
@@ -336,7 +336,7 @@ body.popup .submit-row {
color: #666;
padding: 3px 5px;
border-bottom: 1px solid #ddd;
- background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
+ background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
}
.inline-group .tabular tr.add-row td {
@@ -347,7 +347,7 @@ body.popup .submit-row {
.inline-group ul.tools a.add,
.inline-group div.add-row a,
.inline-group .tabular tr.add-row td a {
- background: url(../img/admin/icon_addlink.gif) 0 50% no-repeat;
+ background: url(../img/icon_addlink.gif) 0 50% no-repeat;
padding-left: 14px;
font-size: 11px;
outline: 0; /* Remove dotted border around link */
View
2  django/contrib/admin/media/css/ie.css → django/contrib/admin/static/admin/css/ie.css
@@ -53,5 +53,5 @@
/* IE doesn't know alpha transparency in PNGs */
.inline-deletelink {
- background: transparent url(../img/admin/inline-delete-8bit.png) no-repeat;
+ background: transparent url(../img/inline-delete-8bit.png) no-repeat;
}
View
0  django/contrib/admin/media/css/login.css → .../contrib/admin/static/admin/css/login.css
File renamed without changes
View
4 django/contrib/admin/media/css/rtl.css → ...go/contrib/admin/static/admin/css/rtl.css
@@ -113,7 +113,7 @@ table thead th.sorted a span.sortpos {
}
.change-list .filtered {
- background: white url(../img/admin/changelist-bg_rtl.gif) top left repeat-y !important;
+ background: white url(../img/changelist-bg_rtl.gif) top left repeat-y !important;
}
.change-list .filtered table {
@@ -170,7 +170,7 @@ table thead th.sorted a span.sortpos {
}
.submit-row .deletelink {
- background: url(../img/admin/icon_deletelink.gif) 0 50% no-repeat;
+ background: url(../img/icon_deletelink.gif) 0 50% no-repeat;
padding-right: 14px;
}
View
40 django/contrib/admin/media/css/widgets.css → ...ontrib/admin/static/admin/css/widgets.css
@@ -22,7 +22,7 @@
}
.selector .selector-available h2 {
- background: white url(../img/admin/nav-bg.gif) bottom left repeat-x;
+ background: white url(../img/nav-bg.gif) bottom left repeat-x;
color: #666;
}
@@ -49,7 +49,7 @@
float: left;
width: 22px;
height: 50px;
- background: url(../img/admin/chooser-bg.gif) top center no-repeat;
+ background: url(../img/chooser-bg.gif) top center no-repeat;
margin: 8em 3px 0 3px;
padding: 0;
}
@@ -74,12 +74,12 @@
}
.selector-add {
- background: url(../img/admin/selector-add.gif) top center no-repeat;
+ background: url(../img/selector-add.gif) top center no-repeat;
margin-bottom: 2px;
}
.selector-remove {
- background: url(../img/admin/selector-remove.gif) top center no-repeat;
+ background: url(../img/selector-remove.gif) top center no-repeat;
}
a.selector-chooseall, a.selector-clearall {
@@ -99,11 +99,11 @@ a.selector-chooseall:hover, a.selector-clearall:hover {
a.selector-chooseall {
width: 7em;
- background: url(../img/admin/selector-addall.gif) left center no-repeat;
+ background: url(../img/selector-addall.gif) left center no-repeat;
}
a.selector-clearall {
- background: url(../img/admin/selector-removeall.gif) left center no-repeat;
+ background: url(../img/selector-removeall.gif) left center no-repeat;
}
@@ -135,7 +135,7 @@ a.selector-clearall {
height: 22px;
width: 50px;
margin: 0 0 3px 40%;
- background: url(../img/admin/chooser_stacked-bg.gif) top center no-repeat;
+ background: url(../img/chooser_stacked-bg.gif) top center no-repeat;
}
.stacked .selector-chooser li {
@@ -148,11 +148,11 @@ a.selector-clearall {
}
.stacked .selector-add {
- background-image: url(../img/admin/selector_stacked-add.gif);
+ background-image: url(../img/selector_stacked-add.gif);
}
.stacked .selector-remove {
- background-image: url(../img/admin/selector_stacked-remove.gif);
+ background-image: url(../img/selector_stacked-remove.gif);
}
@@ -246,7 +246,7 @@ span.clearable-file-input label {
color: #666;
padding: 2px 3px;
text-align: center;
- background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x;
+ background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x;
border-bottom: 1px solid #ddd;
}
@@ -314,7 +314,7 @@ span.clearable-file-input label {
position: absolute;
font-weight: bold;
font-size: 12px;
- background: #C9DBED url(../img/admin/default-bg.gif) bottom left repeat-x;
+ background: #C9DBED url(../img/default-bg.gif) bottom left repeat-x;
padding: 1px 4px 2px 4px;
color: white;
}
@@ -337,7 +337,7 @@ span.clearable-file-input label {
margin: 0 !important;
padding: 0;
font-size: 10px;
- background: #e1e1e1 url(../img/admin/nav-bg.gif) 0 50% repeat-x;
+ background: #e1e1e1 url(../img/nav-bg.gif) 0 50% repeat-x;
border-top: 1px solid #ddd;
}
@@ -374,7 +374,7 @@ ul.orderer li {
border-width: 0 1px 1px 0;
white-space: nowrap;
overflow: hidden;
- background: #e2e2e2 url(../img/admin/nav-bg-grabber.gif) repeat-y;
+ background: #e2e2e2 url(../img/nav-bg-grabber.gif) repeat-y;
}
ul.orderer li:hover {
@@ -406,7 +406,7 @@ ul.orderer li.selected {
}
ul.orderer li.deleted {
- background: #bbb url(../img/admin/deleted-overlay.gif);
+ background: #bbb url(../img/deleted-overlay.gif);
}
ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited {
@@ -414,7 +414,7 @@ ul.orderer li.deleted a:link, ul.orderer li.deleted a:visited {
}
ul.orderer li.deleted .inline-deletelink {
- background-image: url(../img/admin/inline-restore.png);
+ background-image: url(../img/inline-restore.png);
}
ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
@@ -426,7 +426,7 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
.inline-deletelink {
float: right;
text-indent: -9999px;
- background: transparent url(../img/admin/inline-delete.png) no-repeat;
+ background: transparent url(../img/inline-delete.png) no-repeat;
width: 15px;
height: 15px;
border: 0px none;
@@ -465,11 +465,11 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
}
.editinline tr.deleted {
- background: #ddd url(../img/admin/deleted-overlay.gif);
+ background: #ddd url(../img/deleted-overlay.gif);
}
.editinline tr.deleted .inline-deletelink {
- background-image: url(../img/admin/inline-restore.png);
+ background-image: url(../img/inline-restore.png);
}
.editinline tr.deleted td:hover {
@@ -500,13 +500,13 @@ ul.orderer li.deleted:hover, ul.orderer li.deleted a.selector:hover {
.editinline-stacked .inline-splitter {
float: left;
width: 9px;
- background: #f8f8f8 url(../img/admin/inline-splitter-bg.gif) 50% 50% no-repeat;
+ background: #f8f8f8 url(../img/inline-splitter-bg.gif) 50% 50% no-repeat;
border-right: 1px solid #ccc;
}
.editinline-stacked .controls {
clear: both;
- background: #e1e1e1 url(../img/admin/nav-bg.gif) top left repeat-x;
+ background: #e1e1e1 url(../img/nav-bg.gif) top left repeat-x;
padding: 3px 4px;
font-size: 11px;
border-top: 1px solid #ddd;
View
0  ...trib/admin/media/img/admin/arrow-down.gif → ...rib/admin/static/admin/img/arrow-down.gif
File renamed without changes
View
0  ...ontrib/admin/media/img/admin/arrow-up.gif → ...ntrib/admin/static/admin/img/arrow-up.gif
File renamed without changes
View
0  ...b/admin/media/img/admin/changelist-bg.gif → .../admin/static/admin/img/changelist-bg.gif
File renamed without changes
View
0  ...min/media/img/admin/changelist-bg_rtl.gif → ...in/static/admin/img/changelist-bg_rtl.gif
File renamed without changes
View
0  ...trib/admin/media/img/admin/chooser-bg.gif → ...rib/admin/static/admin/img/chooser-bg.gif
File renamed without changes
View
0  ...in/media/img/admin/chooser_stacked-bg.gif → ...n/static/admin/img/chooser_stacked-bg.gif
File renamed without changes
View
0  ...in/media/img/admin/default-bg-reverse.gif → ...n/static/admin/img/default-bg-reverse.gif
File renamed without changes
View
0  ...trib/admin/media/img/admin/default-bg.gif → ...rib/admin/static/admin/img/default-bg.gif
File renamed without changes
View
0  ...admin/media/img/admin/deleted-overlay.gif → ...dmin/static/admin/img/deleted-overlay.gif
File renamed without changes
View
0  ...b/admin/media/img/gis/move_vertex_off.png → .../static/admin/img/gis/move_vertex_off.png
File renamed without changes
View
0  ...ib/admin/media/img/gis/move_vertex_on.png → ...n/static/admin/img/gis/move_vertex_on.png
File renamed without changes
View
0  ...contrib/admin/media/img/admin/icon-no.gif → ...ontrib/admin/static/admin/img/icon-no.gif
File renamed without changes
View
0  ...ib/admin/media/img/admin/icon-unknown.gif → ...b/admin/static/admin/img/icon-unknown.gif
File renamed without changes
View
0  ...ontrib/admin/media/img/admin/icon-yes.gif → ...ntrib/admin/static/admin/img/icon-yes.gif
File renamed without changes
View
0  ...ib/admin/media/img/admin/icon_addlink.gif → ...b/admin/static/admin/img/icon_addlink.gif
File renamed without changes
View
0  ...trib/admin/media/img/admin/icon_alert.gif → ...rib/admin/static/admin/img/icon_alert.gif
File renamed without changes
View
0  ...b/admin/media/img/admin/icon_calendar.gif → .../admin/static/admin/img/icon_calendar.gif
File renamed without changes
View
0  ...admin/media/img/admin/icon_changelink.gif → ...dmin/static/admin/img/icon_changelink.gif
File renamed without changes
View
0  ...trib/admin/media/img/admin/icon_clock.gif → ...rib/admin/static/admin/img/icon_clock.gif
File renamed without changes
View
0  ...ontrib/admin/media/img/admin/icon_cog.gif → ...ntrib/admin/static/admin/img/icon_cog.gif
File renamed without changes
View
0  ...admin/media/img/admin/icon_deletelink.gif → ...dmin/static/admin/img/icon_deletelink.gif
File renamed without changes
View
0  ...trib/admin/media/img/admin/icon_error.gif → ...rib/admin/static/admin/img/icon_error.gif
File renamed without changes
View
0  .../admin/media/img/admin/icon_searchbox.png → ...admin/static/admin/img/icon_searchbox.png
File renamed without changes
View
0  ...ib/admin/media/img/admin/icon_success.gif → ...b/admin/static/admin/img/icon_success.gif
File renamed without changes
View
0  ...in/media/img/admin/inline-delete-8bit.png → ...n/static/admin/img/inline-delete-8bit.png
File renamed without changes
View
0  ...b/admin/media/img/admin/inline-delete.png → .../admin/static/admin/img/inline-delete.png
Diff not rendered
View
0  ...n/media/img/admin/inline-restore-8bit.png → .../static/admin/img/inline-restore-8bit.png
Diff not rendered
View
0  .../admin/media/img/admin/inline-restore.png → ...admin/static/admin/img/inline-restore.png
Diff not rendered
View
0  ...in/media/img/admin/inline-splitter-bg.gif → ...n/static/admin/img/inline-splitter-bg.gif
Diff not rendered
View
0  .../admin/media/img/admin/nav-bg-grabber.gif → ...admin/static/admin/img/nav-bg-grabber.gif
Diff not rendered
View
0  .../admin/media/img/admin/nav-bg-reverse.gif → ...admin/static/admin/img/nav-bg-reverse.gif
Diff not rendered
View
0  ...admin/media/img/admin/nav-bg-selected.gif → ...dmin/static/admin/img/nav-bg-selected.gif
Diff not rendered
View
0  .../contrib/admin/media/img/admin/nav-bg.gif → ...contrib/admin/static/admin/img/nav-bg.gif
Diff not rendered
View
0  ...ib/admin/media/img/admin/selector-add.gif → ...b/admin/static/admin/img/selector-add.gif
Diff not rendered
View
0  ...admin/media/img/admin/selector-addall.gif → ...dmin/static/admin/img/selector-addall.gif
Diff not rendered
View
0  ...admin/media/img/admin/selector-remove.gif → ...dmin/static/admin/img/selector-remove.gif
Diff not rendered
View
0  ...in/media/img/admin/selector-removeall.gif → ...n/static/admin/img/selector-removeall.gif
Diff not rendered
View
0  ...admin/media/img/admin/selector-search.gif → ...dmin/static/admin/img/selector-search.gif
Diff not rendered
View
0  .../media/img/admin/selector_stacked-add.gif → ...static/admin/img/selector_stacked-add.gif
Diff not rendered
View
0  ...dia/img/admin/selector_stacked-remove.gif → ...tic/admin/img/selector_stacked-remove.gif
Diff not rendered
View
0  ...ntrib/admin/media/img/admin/tool-left.gif → ...trib/admin/static/admin/img/tool-left.gif
Diff not rendered
View
0  .../admin/media/img/admin/tool-left_over.gif → ...admin/static/admin/img/tool-left_over.gif
Diff not rendered
View
0  ...trib/admin/media/img/admin/tool-right.gif → ...rib/admin/static/admin/img/tool-right.gif
Diff not rendered
View
0  ...admin/media/img/admin/tool-right_over.gif → ...dmin/static/admin/img/tool-right_over.gif
Diff not rendered
View
0  ...rib/admin/media/img/admin/tooltag-add.gif → ...ib/admin/static/admin/img/tooltag-add.gif
Diff not rendered
View
0  ...dmin/media/img/admin/tooltag-add_over.gif → ...min/static/admin/img/tooltag-add_over.gif
Diff not rendered
View
0  ...in/media/img/admin/tooltag-arrowright.gif → ...n/static/admin/img/tooltag-arrowright.gif
Diff not rendered
View
0  ...dia/img/admin/tooltag-arrowright_over.gif → ...tic/admin/img/tooltag-arrowright_over.gif
Diff not rendered
View
0  ...contrib/admin/media/js/LICENSE-JQUERY.txt → .../admin/static/admin/js/LICENSE-JQUERY.txt
File renamed without changes
View
0  django/contrib/admin/media/js/SelectBox.js → ...ontrib/admin/static/admin/js/SelectBox.js
File renamed without changes
View
4 ...o/contrib/admin/media/js/SelectFilter2.js → ...ib/admin/static/admin/js/SelectFilter2.js
@@ -50,7 +50,7 @@ var SelectFilter = {
var search_filter_label = quickElement('label', filter_p, '', 'for', field_id + "_input", 'style', 'width:16px;padding:2px');
- var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/admin/selector-search.gif');
+ var search_selector_img = quickElement('img', search_filter_label, '', 'src', admin_media_prefix + 'img/selector-search.gif');
search_selector_img.alt = gettext("Filter");
filter_p.appendChild(document.createTextNode(' '));
@@ -75,7 +75,7 @@ var SelectFilter = {
quickElement('h2', selector_chosen, interpolate(gettext('Chosen %s'), [field_name]));
var selector_filter = quickElement('p', selector_chosen, gettext('Select your choice(s) and click '));
selector_filter.className = 'selector-filter';
- quickElement('img', selector_filter, '', 'src', admin_media_prefix + (is_stacked ? 'img/admin/selector_stacked-add.gif':'img/admin/selector-add.gif'), 'alt', 'Add');
+ quickElement('img', selector_filter, '', 'src', admin_media_prefix + (is_stacked ? 'img/selector_stacked-add.gif':'img/selector-add.gif'), 'alt', 'Add');
var to_box = quickElement('select', selector_chosen, '', 'id', field_id + '_to', 'multiple', 'multiple', 'size', from_box.size, 'name', from_box.getAttribute('name'));
to_box.className = 'filtered';
var clear_all = quickElement('a', selector_chosen, gettext('Clear all'), 'href', 'javascript: (function() { SelectBox.move_all("' + field_id + '_to", "' + field_id + '_from");})()');
View
0  django/contrib/admin/media/js/actions.js → .../contrib/admin/static/admin/js/actions.js
File renamed without changes
View
0  django/contrib/admin/media/js/actions.min.js → ...trib/admin/static/admin/js/actions.min.js
File renamed without changes
View
4 ...admin/media/js/admin/DateTimeShortcuts.js → ...tatic/admin/js/admin/DateTimeShortcuts.js
@@ -50,7 +50,7 @@ var DateTimeShortcuts = {
var clock_link = document.createElement('a');
clock_link.setAttribute('href', 'javascript:DateTimeShortcuts.openClock(' + num + ');');
clock_link.id = DateTimeShortcuts.clockLinkName + num;
- quickElement('img', clock_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/admin/icon_clock.gif', 'alt', gettext('Clock'));
+ quickElement('img', clock_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_clock.gif', 'alt', gettext('Clock'));
shortcuts_span.appendChild(document.createTextNode('\240'));
shortcuts_span.appendChild(now_link);
shortcuts_span.appendChild(document.createTextNode('\240|\240'));
@@ -138,7 +138,7 @@ var DateTimeShortcuts = {
var cal_link = document.createElement('a');
cal_link.setAttribute('href', 'javascript:DateTimeShortcuts.openCalendar(' + num + ');');
cal_link.id = DateTimeShortcuts.calendarLinkName + num;
- quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/admin/icon_calendar.gif', 'alt', gettext('Calendar'));
+ quickElement('img', cal_link, '', 'src', DateTimeShortcuts.admin_media_prefix + 'img/icon_calendar.gif', 'alt', gettext('Calendar'));
shortcuts_span.appendChild(document.createTextNode('\240'));
shortcuts_span.appendChild(today_link);
shortcuts_span.appendChild(document.createTextNode('\240|\240'));
View
0  ...in/media/js/admin/RelatedObjectLookups.js → ...ic/admin/js/admin/RelatedObjectLookups.js
File renamed without changes
View
0  .../contrib/admin/media/js/admin/ordering.js → ...b/admin/static/admin/js/admin/ordering.js
File renamed without changes
View
0  django/contrib/admin/media/js/calendar.js → ...contrib/admin/static/admin/js/calendar.js
File renamed without changes
View
0  django/contrib/admin/media/js/collapse.js → ...contrib/admin/static/admin/js/collapse.js
File renamed without changes
View
0  ...go/contrib/admin/media/js/collapse.min.js → ...rib/admin/static/admin/js/collapse.min.js
File renamed without changes
View
0  django/contrib/admin/media/js/compress.py → ...contrib/admin/static/admin/js/compress.py
File renamed without changes
View
0  django/contrib/admin/media/js/core.js → django/contrib/admin/static/admin/js/core.js
File renamed without changes
View
0  ...b/admin/media/js/getElementsBySelector.js → .../static/admin/js/getElementsBySelector.js
File renamed without changes
View
0  django/contrib/admin/media/js/inlines.js → .../contrib/admin/static/admin/js/inlines.js
File renamed without changes
View
0  django/contrib/admin/media/js/inlines.min.js → ...trib/admin/static/admin/js/inlines.min.js
File renamed without changes
View
0  django/contrib/admin/media/js/jquery.init.js → ...trib/admin/static/admin/js/jquery.init.js
File renamed without changes
View
0  django/contrib/admin/media/js/jquery.js → ...o/contrib/admin/static/admin/js/jquery.js
File renamed without changes
View
0  django/contrib/admin/media/js/jquery.min.js → ...ntrib/admin/static/admin/js/jquery.min.js
File renamed without changes
View
0  django/contrib/admin/media/js/prepopulate.js → ...trib/admin/static/admin/js/prepopulate.js
File renamed without changes
View
0  ...contrib/admin/media/js/prepopulate.min.js → .../admin/static/admin/js/prepopulate.min.js
File renamed without changes
View
0  django/contrib/admin/media/js/timeparse.js → ...ontrib/admin/static/admin/js/timeparse.js
File renamed without changes
View
0  django/contrib/admin/media/js/urlify.js → ...o/contrib/admin/static/admin/js/urlify.js
File renamed without changes
View
4 django/contrib/admin/templates/admin/auth/user/change_password.html
@@ -1,11 +1,11 @@
{% extends "admin/base_site.html" %}
-{% load i18n admin_modify adminmedia %}
+{% load i18n static admin_modify %}
{% load url from future %}
{% block extrahead %}{{ block.super }}
{% url 'admin:jsi18n' as jsi18nurl %}
<script type="text/javascript" src="{{ jsi18nurl|default:"../../../../jsi18n/" }}"></script>
{% endblock %}
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}
{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
View
10 django/contrib/admin/templates/admin/base.html
@@ -1,12 +1,12 @@
-{% load url from future %}<!DOCTYPE html>
+{% load static %}{% load url from future %}<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>{% block title %}{% endblock %}</title>
-<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" />
+<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
{% block extrastyle %}{% endblock %}
-<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% load adminmedia %}{% admin_media_prefix %}css/ie.css{% endblock %}" /><![endif]-->
-{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
-<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";</script>
+<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
+{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
+<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
{% block extrahead %}{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
</head>
View
4 django/contrib/admin/templates/admin/change_form.html
@@ -1,5 +1,5 @@
{% extends "admin/base_site.html" %}
-{% load i18n admin_modify adminmedia %}
+{% load i18n static admin_modify %}
{% load url from future %}
{% block extrahead %}{{ block.super }}
@@ -8,7 +8,7 @@
{{ media }}
{% endblock %}
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}
View
6 django/contrib/admin/templates/admin/change_list.html
@@ -1,11 +1,11 @@
{% extends "admin/base_site.html" %}
-{% load adminmedia admin_list i18n %}
+{% load i18n static admin_list %}
{% load url from future %}
{% block extrastyle %}
{{ block.super }}
- <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/changelists.css" />
+ <link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
{% if cl.formset %}
- <link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />
+ <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
{% endif %}
{% if cl.formset or action_form %}
{% url 'admin:jsi18n' as jsi18nurl %}
View
5 django/contrib/admin/templates/admin/change_list_results.html
@@ -1,5 +1,4 @@
-{% load adminmedia %}
-{% load i18n %}
+{% load i18n static %}
{% if result_hidden_fields %}
<div class="hiddenfields">{# DIV for HTML validation #}
{% for item in result_hidden_fields %}{{ item }}{% endfor %}
@@ -16,7 +15,7 @@
<span class="text">{{ header.text|capfirst }}</span>
{% if header.sortable %}
{% if header.sort_pos > 0 %}<span class="sortpos">
- {% if header.sort_pos == 1 %}<img id="primary-sort-icon" src="{% admin_media_prefix %}img/admin/icon_cog.gif" alt="" />&nbsp;{% endif %}
+ {% if header.sort_pos == 1 %}<img id="primary-sort-icon" src="{% static "admin/img/icon_cog.gif" %}" alt="" />&nbsp;{% endif %}
{{ header.sort_pos }}</span>
{% endif %}
<span class="clear"></span></a>
View
6 django/contrib/admin/templates/admin/edit_inline/stacked.html
@@ -1,4 +1,4 @@
-{% load i18n adminmedia %}
+{% load i18n static %}
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
<h2>{{ inline_admin_formset.opts.verbose_name_plural|title }}</h2>
{{ inline_admin_formset.formset.management_form }}
@@ -40,11 +40,11 @@
if (typeof SelectFilter != "undefined"){
$(".selectfilter").each(function(index, value){
var namearr = value.name.split('-');
- SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% admin_media_prefix %}");
+ SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% static "admin/" %}");
});
$(".selectfilterstacked").each(function(index, value){
var namearr = value.name.split('-');
- SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}");
+ SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% static "admin/" %}");
});
}
}
View
6 django/contrib/admin/templates/admin/edit_inline/tabular.html
@@ -1,4 +1,4 @@
-{% load i18n adminmedia admin_modify %}
+{% load i18n static admin_modify %}
<div class="inline-group" id="{{ inline_admin_formset.formset.prefix }}-group">
<div class="tabular inline-related {% if forloop.last %}last-related{% endif %}">
{{ inline_admin_formset.formset.management_form }}
@@ -86,11 +86,11 @@
if (typeof SelectFilter != "undefined"){
$(".selectfilter").each(function(index, value){
var namearr = value.name.split('-');
- SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% admin_media_prefix %}");
+ SelectFilter.init(value.id, namearr[namearr.length-1], false, "{% static "admin/" %}");
});
$(".selectfilterstacked").each(function(index, value){
var namearr = value.name.split('-');
- SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% admin_media_prefix %}");
+ SelectFilter.init(value.id, namearr[namearr.length-1], true, "{% static "admin/" %}");
});
}
}
View
4 django/contrib/admin/templates/admin/index.html
@@ -1,7 +1,7 @@
{% extends "admin/base_site.html" %}
-{% load i18n %}
+{% load i18n static %}
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />{% endblock %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/dashboard.css" %}" />{% endblock %}
{% block coltype %}colMS{% endblock %}
View
4 django/contrib/admin/templates/admin/login.html
@@ -1,7 +1,7 @@
{% extends "admin/base_site.html" %}
-{% load i18n %}
+{% load i18n static %}
-{% block extrastyle %}{% load adminmedia %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/login.css" />{% endblock %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/login.css" %}" />{% endblock %}
{% block bodyclass %}login{% endblock %}
View
5 django/contrib/admin/templates/admin/search_form.html
@@ -1,9 +1,8 @@
-{% load adminmedia %}
-{% load i18n %}
+{% load i18n static %}
{% if cl.search_fields %}
<div id="toolbar"><form id="changelist-search" action="" method="get">
<div><!-- DIV needed for valid HTML -->
-<label for="searchbar"><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" alt="Search" /></label>
+<label for="searchbar"><img src="{% static "admin/img/icon_searchbox.png" %}" alt="Search" /></label>
<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" />
<input type="submit" value="{% trans 'Search' %}" />
{% if show_result_count %}
View
4 django/contrib/admin/templates/registration/password_change_form.html
@@ -1,7 +1,7 @@
{% extends "admin/base_site.html" %}
-{% load i18n adminmedia %}
+{% load i18n static %}
{% load url from future %}
-{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% admin_media_prefix %}css/forms.css" />{% endblock %}
+{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />{% endblock %}
{% block userlinks %}{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %} {% trans 'Change password' %} / <a href="../logout/">{% trans 'Log out' %}</a>{% endblock %}
{% block breadcrumbs %}<div class="breadcrumbs"><a href="../">{% trans 'Home' %}</a> &rsaquo; {% trans 'Password change' %}</div>{% endblock %}
View
7 django/contrib/admin/templatetags/admin_list.py
@@ -6,6 +6,7 @@
ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR)
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
+from django.templatetags.static import static
from django.utils import formats
from django.utils.datastructures import SortedDict
from django.utils.html import escape, conditional_escape
@@ -154,9 +155,9 @@ def result_headers(cl):
}
def _boolean_icon(field_val):
- BOOLEAN_MAPPING = {True: 'yes', False: 'no', None: 'unknown'}
- return mark_safe(u'<img src="%simg/admin/icon-%s.gif" alt="%s" />' %
- (settings.ADMIN_MEDIA_PREFIX, BOOLEAN_MAPPING[field_val], field_val))
+ icon_url = static('admin/img/icon-%s.gif' %
+ {True: 'yes', False: 'no', None: 'unknown'}[field_val])
+ return mark_safe(u'<img src="%s" alt="%s" />' % (icon_url, field_val))
def items_for_result(cl, result, form):
"""
View
4 django/contrib/admin/templatetags/adminmedia.py
@@ -1,3 +1,4 @@
+import warnings
from django.template import Library
from django.templatetags.static import PrefixNode
@@ -8,4 +9,7 @@ def admin_media_prefix():
"""
Returns the string contained in the setting ADMIN_MEDIA_PREFIX.
"""
+ warnings.warn(
+ "The admin_media_prefix template tag is deprecated. "
+ "Use the static template tag instead.", PendingDeprecationWarning)
return PrefixNode.handle_simple("ADMIN_MEDIA_PREFIX")
View
34 django/contrib/admin/widgets.py
@@ -4,15 +4,16 @@
import copy
from django import forms
+from django.conf import settings
+from django.core.urlresolvers import reverse, NoReverseMatch
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
+from django.templatetags.static import static
from django.utils.html import escape
from django.utils.text import truncate_words
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.utils.encoding import force_unicode
-from django.conf import settings
-from django.core.urlresolvers import reverse, NoReverseMatch
class FilteredSelectMultiple(forms.SelectMultiple):
"""
@@ -22,9 +23,8 @@ class FilteredSelectMultiple(forms.SelectMultiple):
catalog has been loaded in the page
"""
class Media:
- js = (settings.ADMIN_MEDIA_PREFIX + "js/core.js",
- settings.ADMIN_MEDIA_PREFIX + "js/SelectBox.js",
- settings.ADMIN_MEDIA_PREFIX + "js/SelectFilter2.js")
+ js = ["admin/js/%s" % path
+ for path in ["core.js", "SelectBox.js", "SelectFilter2.js"]]
def __init__(self, verbose_name, is_stacked, attrs=None, choices=()):
self.verbose_name = verbose_name
@@ -39,22 +39,20 @@ def render(self, name, value, attrs=None, choices=()):
output.append(u'<script type="text/javascript">addEvent(window, "load", function(e) {')
# TODO: "id_" is hard-coded here. This should instead use the correct
# API to determine the ID dynamically.
- output.append(u'SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n' % \
- (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), settings.ADMIN_MEDIA_PREFIX))
+ output.append(u'SelectFilter.init("id_%s", "%s", %s, "%s"); });</script>\n'
+ % (name, self.verbose_name.replace('"', '\\"'), int(self.is_stacked), static('admin/')))
return mark_safe(u''.join(output))
class AdminDateWidget(forms.DateInput):
class Media:
- js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js",
- settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js")
+ js = ["admin/js/calendar.js", "admin/js/admin/DateTimeShortcuts.js"]
def __init__(self, attrs={}, format=None):
super(AdminDateWidget, self).__init__(attrs={'class': 'vDateField', 'size': '10'}, format=format)
class AdminTimeWidget(forms.TimeInput):
class Media:
- js = (settings.ADMIN_MEDIA_PREFIX + "js/calendar.js",
- settings.ADMIN_MEDIA_PREFIX + "js/admin/DateTimeShortcuts.js")
+ js = ["admin/js/calendar.js", "admin/js/admin/DateTimeShortcuts.js"]
def __init__(self, attrs={}, format=None):
super(AdminTimeWidget, self).__init__(attrs={'class': 'vTimeField', 'size': '8'}, format=format)
@@ -134,9 +132,10 @@ def render(self, name, value, attrs=None):
output = [super(ForeignKeyRawIdWidget, self).render(name, value, attrs)]
# TODO: "id_" is hard-coded here. This should instead use the correct
# API to determine the ID dynamically.
- output.append(u'<a href="%s%s" class="related-lookup" id="lookup_id_%s" onclick="return showRelatedObjectLookupPopup(this);"> ' % \
- (related_url, url, name))
- output.append(u'<img src="%simg/admin/selector-search.gif" width="16" height="16" alt="%s" /></a>' % (settings.ADMIN_MEDIA_PREFIX, _('Lookup')))
+ output.append(u'<a href="%s%s" class="related-lookup" id="lookup_id_%s" onclick="return showRelatedObjectLookupPopup(this);"> '
+ % (related_url, url, name))
+ output.append(u'<img src="%s" width="16" height="16" alt="%s" /></a>'
+ % (static('admin/img/selector-search.gif'), _('Lookup')))
if value:
output.append(self.label_for_value(value))
return mark_safe(u''.join(output))
@@ -240,9 +239,10 @@ def render(self, name, value, *args, **kwargs):
if self.can_add_related:
# TODO: "id_" is hard-coded here. This should instead use the correct
# API to determine the ID dynamically.
- output.append(u'<a href="%s" class="add-another" id="add_id_%s" onclick="return showAddAnotherPopup(this);"> ' % \
- (related_url, name))
- output.append(u'<img src="%simg/admin/icon_addlink.gif" width="10" height="10" alt="%s"/></a>' % (settings.ADMIN_MEDIA_PREFIX, _('Add Another')))
+ output.append(u'<a href="%s" class="add-another" id="add_id_%s" onclick="return showAddAnotherPopup(this);"> '
+ % (related_url, name))
+ output.append(u'<img src="%s" width="10" height="10" alt="%s"/></a>'
+ % (static('admin/img/icon_addlink.gif'), _('Add Another')))
return mark_safe(u''.join(output))
def build_attrs(self, extra_attrs=None, **kwargs):
View
11 django/contrib/gis/admin/widgets.py
@@ -1,15 +1,16 @@
from django.conf import settings
-from django.contrib.gis.gdal import OGRException
-from django.contrib.gis.geos import GEOSGeometry, GEOSException
from django.forms.widgets import Textarea
from django.template import loader, Context
+from django.templatetags.static import static
from django.utils import translation
+from django.contrib.gis.gdal import OGRException
+from django.contrib.gis.geos import GEOSGeometry, GEOSException
+
# Creating a template context that contains Django settings
# values needed by admin map templates.
-geo_context = Context({'ADMIN_MEDIA_PREFIX' : settings.ADMIN_MEDIA_PREFIX,
- 'LANGUAGE_BIDI' : translation.get_language_bidi(),
- })
+geo_context = Context({'ADMIN_MEDIA_PREFIX' : static('admin/'),
+ 'LANGUAGE_BIDI' : translation.get_language_bidi()})
class OpenLayersWidget(Textarea):
"""
View
5 django/contrib/gis/templates/gis/admin/openlayers.html
@@ -1,15 +1,16 @@
{% block extrastyle %}
+{% load static %}
<style type="text/css">
#{{ id }}_map { width: {{ map_width }}px; height: {{ map_height }}px; }
#{{ id }}_map .aligned label { float:inherit; }
#{{ id }}_admin_map { position: relative; vertical-align: top; float: {{ LANGUAGE_BIDI|yesno:"right,left" }}; }
{% if not display_wkt %}#{{ id }} { display: none; }{% endif %}
.olControlEditingToolbar .olControlModifyFeatureItemActive {
- background-image: url("{{ ADMIN_MEDIA_PREFIX }}img/gis/move_vertex_on.png");
+ background-image: url("{% static "admin/img/gis/move_vertex_on.png" %}");
background-repeat: no-repeat;
}
.olControlEditingToolbar .olControlModifyFeatureItemInactive {
- background-image: url("{{ ADMIN_MEDIA_PREFIX }}img/gis/move_vertex_off.png");
+ background-image: url("{% static "admin/img/gis/move_vertex_off.png" %}");
background-repeat: no-repeat;
}
</style>
View
9 django/contrib/staticfiles/storage.py
@@ -43,14 +43,7 @@ def __init__(self, app, *args, **kwargs):
Returns a static file storage if available in the given app.
"""
# app is the actual app module
- self.app_module = app
- # We special case the admin app here since it has its static files
- # in 'media' for historic reasons.
- if self.app_module == 'django.contrib.admin':
- self.prefix = 'admin'
- self.source_dir = 'media'
- mod = import_module(self.app_module)
+ mod = import_module(app)
mod_path = os.path.dirname(mod.__file__)
location = os.path.join(mod_path, self.source_dir)
super(AppStaticStorage, self).__init__(location, *args, **kwargs)
-
View
13 django/core/servers/basehttp.py
@@ -12,6 +12,7 @@
import sys
import traceback
import urllib
+import urlparse
from SocketServer import ThreadingMixIn
from wsgiref import simple_server
from wsgiref.util import FileWrapper # for backwards compatibility
@@ -91,7 +92,7 @@ class WSGIRequestHandler(simple_server.WSGIRequestHandler, object):
def __init__(self, *args, **kwargs):
from django.conf import settings
- self.admin_media_prefix = settings.ADMIN_MEDIA_PREFIX
+ self.admin_media_prefix = urlparse.urljoin(settings.STATIC_URL, 'admin/')
# We set self.path to avoid crashes in log_message() on unsupported
# requests (like "OPTIONS").
self.path = ''
@@ -163,22 +164,18 @@ def log_message(self, format, *args):
class AdminMediaHandler(handlers.StaticFilesHandler):
"""
WSGI middleware that intercepts calls to the admin media directory, as
- defined by the ADMIN_MEDIA_PREFIX setting, and serves those images.
+ defined by the STATIC_URL setting, and serves those images.
Use this ONLY LOCALLY, for development! This hasn't been tested for
security and is not super efficient.
This is pending for deprecation since 1.3.
"""
def get_base_dir(self):
- return os.path.join(django.__path__[0], 'contrib', 'admin', 'media')
+ return os.path.join(django.__path__[0], 'contrib', 'admin', 'static', 'admin')
def get_base_url(self):
from django.conf import settings
- if not settings.ADMIN_MEDIA_PREFIX:
- raise ImproperlyConfigured(
- "The ADMIN_MEDIA_PREFIX setting can't be empty "
- "when using the AdminMediaHandler, e.g. with runserver.")
- return settings.ADMIN_MEDIA_PREFIX
+ return urlparse.urljoin(settings.STATIC_URL, 'admin/')
def file_path(self, url):
"""
View
20 django/templatetags/static.py
@@ -1,3 +1,4 @@
+from urlparse import urljoin
from django import template
from django.utils.encoding import iri_to_uri
@@ -68,7 +69,7 @@ def get_static_prefix(parser, token):
@register.tag
def get_media_prefix(parser, token):
"""
- Populates a template variable with the static prefix,
+ Populates a template variable with the media prefix,
``settings.MEDIA_URL``.
Usage::
@@ -82,3 +83,20 @@ def get_media_prefix(parser, token):
"""
return PrefixNode.handle_token(parser, token, "MEDIA_URL")
+
+@register.simple_tag
+def static(path):
+ """
+ Joins the given path with the STATIC_URL setting.
+
+ Usage::
+
+ {% static path %}
+
+ Examples::
+
+ {% static "myapp/css/base.css" %}
+ {% static variable_with_path %}
+
+ """
+ return urljoin(PrefixNode.handle_simple("STATIC_URL"), path)
View
28 docs/howto/static-files.txt
@@ -183,18 +183,34 @@ To see how that works, and to read more details, check out
With a template tag
-------------------
-The second option is the :ttag:`get_static_prefix` template tag. You can
-use this if you're not using :class:`~django.template.RequestContext`, or if you
-need more control over exactly where and how :setting:`STATIC_URL` is
-injected into the template. Here's an example:
+To easily link to static files Django ships with a :ttag:`static` template tag.
+
+.. code-block:: html+django
+
+ {% load static %}
+ <img src="{% static "images/hi.jpg" %}" />
+
+It is also able to consume standard context variables, e.g. assuming a
+``user_stylesheet`` variable is passed to the template:
+
+.. code-block:: html+django
+
+ {% load static %}
+ <link rel="stylesheet" href="{% static user_stylesheet %}" type="text/css" media="screen" />
+
+Another option is the :ttag:`get_static_prefix` template tag. You can use
+this if you're not using :class:`~django.template.RequestContext` (and
+therefore not relying on the ``django.core.context_processors.static``
+context processor), or if you need more control over exactly where and how
+:setting:`STATIC_URL` is injected into the template. Here's an example:
.. code-block:: html+django
{% load static %}
<img src="{% get_static_prefix %}images/hi.jpg" />
-There's also a second form you can use to avoid extra processing if you need the
-value multiple times:
+There's also a second form you can use to avoid extra processing if you need
+the value multiple times:
.. code-block:: html+django
View
5 docs/internals/deprecation.txt
@@ -215,6 +215,11 @@ their deprecation, as per the :ref:`Django deprecation policy
:setting:`LOGGING` setting should include this filter explicitly if
it is desired.
+ * The template tag
+ :func:`django.contrib.admin.templatetags.adminmedia.admin_media_prefix`
+ was deprecated since Django 1.4 and will be removed in favor of the
+ generic static files handling.
+
* 2.0
* ``django.views.defaults.shortcut()``. This function has been moved
to ``django.contrib.contenttypes.views.shortcut()`` as part of the
View
45 docs/ref/contrib/staticfiles.txt
@@ -228,42 +228,23 @@ Example usage::
Other Helpers
=============
-The ``static`` context processor
---------------------------------
+There are a few other helpers outside of the
+:mod:`staticfiles <django.contrib.staticfiles>` app to work with static
+files:
-.. function:: django.core.context_processors.static
+ - The :func:`django.core.context_processors.static` context processor
+ which adds :setting:`STATIC_URL` to every template context rendered
+ with :class:`~django.template.RequestContext` contexts.
-This context processor adds the :setting:`STATIC_URL` into each template
-context as the variable ``{{ STATIC_URL }}``. To use it, make sure that
-``'django.core.context_processors.static'`` appears somewhere in your
-:setting:`TEMPLATE_CONTEXT_PROCESSORS` setting.
+ - The builtin template tag :ttag:`static` which takes a path and
+ joins it with the the static prefix :setting:`STATIC_URL`.
-Remember, only templates rendered with :class:`~django.template.RequestContext`
-will have acces to the data provided by this (and any) context processor.
+ - The builtin template tag :ttag:`get_static_prefix` which populates a
+ template variable with the static prefix :setting:`STATIC_URL` to be
+ used as a variable or directly.
-.. templatetag:: get_static_prefix
-
-The ``get_static_prefix`` templatetag
-=====================================
-
-.. highlight:: html+django
-
-If you're not using :class:`~django.template.RequestContext`, or if you need
-more control over exactly where and how :setting:`STATIC_URL` is injected
-into the template, you can use the :ttag:`get_static_prefix` template tag
-instead::
-
- {% load static %}
- <img src="{% get_static_prefix %}images/hi.jpg" />
-
-There's also a second form you can use to avoid extra processing if you need
-the value multiple times::
-
- {% load static %}
- {% get_static_prefix as STATIC_PREFIX %}
-
- <img src="{{ STATIC_PREFIX }}images/hi.jpg" />
- <img src="{{ STATIC_PREFIX }}images/hi2.jpg" />
+ - The similar template tag :ttag:`get_media_prefix` which works like
+ :ttag:`get_static_prefix` but uses :setting:`MEDIA_URL`.
.. _staticfiles-development-view:
View
14 docs/ref/settings.txt
@@ -44,20 +44,6 @@ modules (in the format ``'foo.bar.baz'``) for which this site is an admin.
The admin site uses this in its automatically-introspected documentation of
models, views and template tags.
-.. setting:: ADMIN_MEDIA_PREFIX
-
-ADMIN_MEDIA_PREFIX
-------------------
-
-Default: ``'/static/admin/'``
-
-The URL prefix for admin media -- CSS, JavaScript and images used by the Django
-administrative interface. Make sure to use a trailing slash, and to have this be
-different from the :setting:`MEDIA_URL` setting (since the same URL cannot be
-mapped onto two different sets of files). For integration with :doc:`staticfiles
-</ref/contrib/staticfiles>`, this should be the same as
-:setting:`STATIC_URL` followed by ``'admin/'``.
-
.. setting:: ADMINS
ADMINS
View
2  docs/ref/templates/api.txt
@@ -479,6 +479,8 @@ value of the :setting:`MEDIA_URL` setting.
django.core.context_processors.static
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+.. function:: django.core.context_processors.static
+
.. versionadded:: 1.3
If :setting:`TEMPLATE_CONTEXT_PROCESSORS` contains this processor, every
View
239 docs/ref/templates/builtins.txt
@@ -17,7 +17,7 @@ Built-in tag reference
.. templatetag:: autoescape
autoescape
-~~~~~~~~~~
+^^^^^^^^^^
Control the current auto-escaping behavior. This tag takes either ``on`` or
``off`` as an argument and that determines whether auto-escaping is in effect
@@ -41,7 +41,7 @@ Sample usage::
.. templatetag:: block
block
-~~~~~
+^^^^^
Define a block that can be overridden by child templates. See
:ref:`Template inheritance <template-inheritance>` for more information.
@@ -49,14 +49,14 @@ Define a block that can be overridden by child templates. See
.. templatetag:: comment
comment
-~~~~~~~
+^^^^^^^
Ignore everything between ``{% comment %}`` and ``{% endcomment %}``
.. templatetag:: csrf_token
csrf_token
-~~~~~~~~~~
+^^^^^^^^^^
In the Django 1.1.X series, this is a no-op tag that returns an empty string for
future compatibility purposes. In Django 1.2 and later, it is used for CSRF
@@ -66,7 +66,7 @@ Forgeries </ref/contrib/csrf>`.
.. templatetag:: cycle
cycle
-~~~~~
+^^^^^
Cycle among the given strings or variables each time this tag is encountered.
@@ -187,7 +187,7 @@ call to ``{% cycle %}`` doesn't specify silent::
.. templatetag:: debug
debug
-~~~~~
+^^^^^
Output a whole load of debugging information, including the current context and
imported modules.
@@ -195,7 +195,7 @@ imported modules.
.. templatetag:: extends
extends
-~~~~~~~
+^^^^^^^
Signal that this template extends a parent template.
@@ -214,7 +214,7 @@ See :ref:`template-inheritance` for more information.
.. templatetag:: filter
filter
-~~~~~~
+^^^^^^
Filter the contents of the variable through variable filters.
@@ -230,7 +230,7 @@ Sample usage::
.. templatetag:: firstof
firstof
-~~~~~~~
+^^^^^^^
Outputs the first variable passed that is not False, without escaping.
@@ -270,7 +270,7 @@ explicitly::
.. templatetag:: for
for
-~~~
+^^^
Loop over each item in an array. For example, to display a list of athletes
provided in ``athlete_list``::
@@ -347,7 +347,7 @@ than -- the following::
.. templatetag:: if
if
-~~
+^^
The ``{% if %}`` tag evaluates a variable, and if that variable is "true" (i.e.
exists, is not empty, and is not a false boolean value) the contents of the
@@ -551,7 +551,7 @@ precedence rules.
.. templatetag:: ifchanged
ifchanged
-~~~~~~~~~
+^^^^^^^^^
Check if a value has changed from the last iteration of a loop.
@@ -595,7 +595,7 @@ will be displayed if the value has not changed::
.. templatetag:: ifequal
ifequal
-~~~~~~~
+^^^^^^^
Output the contents of the block if the two arguments equal each other.
@@ -624,7 +624,7 @@ tag instead.
.. templatetag:: ifnotequal
ifnotequal
-~~~~~~~~~~
+^^^^^^^^^^
Just like ``ifequal``, except it tests that the two arguments are not equal.
@@ -634,7 +634,7 @@ Just like ``ifequal``, except it tests that the two arguments are not equal.
.. templatetag:: include
include
-~~~~~~~
+^^^^^^^
Loads a template and renders it with the current context. This is a way of
"including" other templates within a template.
@@ -687,7 +687,7 @@ See also: ``{% ssi %}``.
.. templatetag:: load
load
-~~~~
+^^^^
Load a custom template tag set.
@@ -710,7 +710,7 @@ more information.
.. templatetag:: now
now
-~~~
+^^^
Display the current date and/or time, using a format according to the given
string. Such string can contain format specifiers characters as described
@@ -744,7 +744,7 @@ This would display as "It is the 4th of September".
.. templatetag:: regroup
regroup
-~~~~~~~
+^^^^^^^
Regroup a list of alike objects by a common attribute.
@@ -855,7 +855,7 @@ an attribute "description," you could use::
{% regroup people by gender.description as gender_list %}
Or, if ``gender`` is a field with ``choices``, it will have a
-:meth:`~django.db.models.Model.get_FOO_display` method available as an
+:meth:`^django.db.models.Model.get_FOO_display` method available as an
attribute, allowing you to group on the display string rather than the
``choices`` key::
@@ -867,7 +867,7 @@ attribute, allowing you to group on the display string rather than the
.. templatetag:: spaceless
spaceless
-~~~~~~~~~
+^^^^^^^^^
Removes whitespace between HTML tags. This includes tab
characters and newlines.
@@ -896,7 +896,7 @@ this example, the space around ``Hello`` won't be stripped::