aboutsummaryrefslogtreecommitdiffstats
path: root/brevisurl/backends/local.py
diff options
context:
space:
mode:
authorVladimir Gorej2012-06-20 20:49:43 +0200
committerVladimir Gorej2012-06-20 20:49:43 +0200
commit178d820541e874fe9913080c5125876b9c0b82ca (patch)
tree9253fc8b190c7e9e957d55ebf7de28609a06c276 /brevisurl/backends/local.py
parent395fa7a203aba58e24362f55a6997f2fc82deb2a (diff)
downloaddjango-brevisurl-178d820541e874fe9913080c5125876b9c0b82ca.tar.bz2
Issue #5; Configure protocol of local backend via settings
Diffstat (limited to 'brevisurl/backends/local.py')
-rw-r--r--brevisurl/backends/local.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/brevisurl/backends/local.py b/brevisurl/backends/local.py
index 741904d..2c54c5b 100644
--- a/brevisurl/backends/local.py
+++ b/brevisurl/backends/local.py
@@ -20,8 +20,6 @@ class TokensExhaustedError(Error):
class BrevisUrlBackend(BaseBrevisUrlBackend):
- PROTOCOL = 'http'
-
def shorten_url(self, original_url):
"""
:raises: ImproperlyConfigured, django.core.exceptions.ValidationError
@@ -46,7 +44,8 @@ class BrevisUrlBackend(BaseBrevisUrlBackend):
kwargs={'token': self.__generate_token()}))
else:
current_site = Site.objects.get_current()
- short_url.shortened_url = '{0}://{1}{2}'.format(self.PROTOCOL, current_site.domain,
+ short_url.shortened_url = '{0}://{1}{2}'.format(brevisurl.settings.LOCAL_BACKEND_DOMAIN_PROTOCOL,
+ current_site.domain,
reverse('brevisurl_redirect',
kwargs={'token': self.__generate_token()}))
short_url.original_url = original_url