Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ADMIN_MEDIA_PREFIX setting instead of hard-coding /m/
git-svn-id: http://code.djangoproject.com/svn/django/trunk@108 bcc190cf-cafb-0310-a4f2-bffc1f526a37
- Loading branch information
1 parent
470db12
commit 68baafc
Showing
5 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
from django.core import template | |||
|
|||
class AdminMediaPrefixNode(template.Node): | |||
def render(self, context): | |||
try: | |||
from django.conf.settings import ADMIN_MEDIA_PREFIX | |||
except ImportError: | |||
return '' | |||
return ADMIN_MEDIA_PREFIX | |||
|
|||
def admin_media_prefix(parser, token): | |||
""" | |||
{% admin_media_prefix %} | |||
""" | |||
bits = token.contents.split() | |||
return AdminMediaPrefixNode() | |||
|
|||
template.register_tag('admin_media_prefix', admin_media_prefix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters