~ubuntu-branches/debian/sid/dico/sid

« back to all changes in this revision

Viewing changes to dicoweb/templatetags/media.py

  • Committer: Bazaar Package Importer
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2009-04-03 06:28:25 UTC
  • Revision ID: james.westby@ubuntu.com-20090403062825-n4tbn09hv9ve5s2s
Tags: upstream-2.0
Import upstream version 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#  This file is part of GNU Dico.
 
2
#  Copyright (C) 2008, 2009 Wojciech Polak
 
3
#
 
4
#  GNU Dico is free software; you can redistribute it and/or modify
 
5
#  it under the terms of the GNU General Public License as published by
 
6
#  the Free Software Foundation; either version 3, or (at your option)
 
7
#  any later version.
 
8
#
 
9
#  GNU Dico is distributed in the hope that it will be useful,
 
10
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
#  GNU General Public License for more details.
 
13
#
 
14
#  You should have received a copy of the GNU General Public License
 
15
#  along with GNU Dico.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
from django.template import Library
 
18
 
 
19
register = Library ()
 
20
 
 
21
def media_prefix ():
 
22
    """Return the string contained in the setting MEDIA_URL."""
 
23
    try:
 
24
        from django.conf import settings
 
25
    except ImportError:
 
26
        return ''
 
27
    return settings.MEDIA_URL
 
28
 
 
29
media_prefix = register.simple_tag (media_prefix)