# -*- coding: utf-8 -*-

from django.conf import settings

def get_url(path):
    proto = 'https://' if settings.SSL_ON else 'http://'
    host = settings.DOMAIN
    return '%s%s%s' % (proto, host, path or '')
# -*- coding: utf-8 -*-

from django.conf import settings
from urlparse import urlsplit,urlunsplit

def get_url(path):
    proto = 'https://' if settings.SSL_ON else 'http://'
    host = settings.DOMAIN
    return '%s%s%s' % (proto, host, path or '')

def get_url_local_path(url):
    parsed = urlsplit(url)
    newlist = ('', '', parsed[2],parsed[3],parsed[4])
    new = urlunsplit(newlist)
    print new
    return new
Add function for getting local path from URL