def get_static_url ( ) : path = getattr ( settings , 'STATIC_URL' , None ) if not path : path = getattr ( settings , 'MEDIA_URL' , None ) if not path : path = '/' return path
python django static pictures in settings
Return a base static url always ending with a /
def get_static_url():
    """Return a base static url, always ending with a /"""
    path = getattr(settings, 'STATIC_URL', None)
    if not path:
        path = getattr(settings, 'MEDIA_URL', None)
    if not path:
        path = '/'
    return path