Mercurial > public > sg101
comparison gcalendar/admin.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 | 9165edfb1709 |
children | 5ba2508939f7 |
comparison
equal
deleted
inserted
replaced
990:81b96f3c9e59 | 991:4aadaf3bc234 |
---|---|
112 def authorize(self, request): | 112 def authorize(self, request): |
113 """ | 113 """ |
114 This view generates the authorization URL and redirects the user to it. | 114 This view generates the authorization URL and redirects the user to it. |
115 """ | 115 """ |
116 site = Site.objects.get_current() | 116 site = Site.objects.get_current() |
117 callback_url = 'http://%s%s' % (site.domain, | 117 callback_url = '%s://%s%s' % ( |
118 settings.SITE_SCHEME, | |
119 site.domain, | |
118 reverse('admin:gcalendar-auth_return')) | 120 reverse('admin:gcalendar-auth_return')) |
119 auth_url = oauth.get_auth_url(callback_url) | 121 auth_url = oauth.get_auth_url(callback_url) |
120 return HttpResponseRedirect(auth_url) | 122 return HttpResponseRedirect(auth_url) |
121 | 123 |
122 def auth_return(self, request): | 124 def auth_return(self, request): |