Mercurial > public > sg101
diff smiley/models.py @ 991:4aadaf3bc234
Added SITE_SCHEME setting.
Configure site scheme to be either http or https based on SITE_SCHEME setting.
Updated code to use it.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 01 Nov 2015 15:56:05 -0600 |
parents | 2908859c2fe4 |
children |
line wrap: on
line diff
--- a/smiley/models.py Sat Oct 31 17:36:31 2015 -0500 +++ b/smiley/models.py Sun Nov 01 15:56:05 2015 -0600 @@ -4,6 +4,7 @@ import re from django.db import models +from django.conf import settings from django.core.cache import cache from django.contrib.sites.models import Site @@ -99,6 +100,6 @@ self.title) else: site = Site.objects.get_current() - return (u'![%s](http://%s%s "%s")' % - (self.title, site.domain, self.image.url, self.title)) + return (u'![%s](%s://%s%s "%s")' % ( + self.title, settings.SITE_SCHEME, site.domain, self.image.url, self.title)) return u''