title: Force Django to use HTTPS URLs when reversing
body: <p>I am running my Django application in Cloud9 for development purposes using the usual ./manage.py runserver. But to the outside world, the app is accessible via a https:// URL.</p>
  
  <p>The problem is that when I use the URL reverse function, the URLs that come back start with http:// (at least some of the time). When I try redirecting to one of those URLs, I get an error like this one in the console:</p>
  
  <pre><code>Mixed Content: The page at 'https://apps.facebook.com/xxxx/' 
  was loaded over HTTPS, but requested an insecure form action 
  'http://xxxx.c9users.io/facebook_app/gift_shop/'. 
  This request has been blocked; the content must be served over HTTPS.
  </code></pre>
  
  <p>My question: is there a way to force reverse to generate HTTPS URLs instead of HTTP?</p>
  
  <p>Here is a snippet of code, which has problems with redirection from HTTPS URLs to HTTP ones:</p>
  
  <pre><code>class IndexRedirectView(RedirectView, CSRFExemptMixin):
      permanent = False
  
      def get_redirect_url(self, *args, **kwargs):
          if self.request.user.visit_count &gt;= 5:
              return reverse('gift-shop')
          if len(BaseGiftableInstance.objects.filter(giving_user=self.request.user)) &gt; 0:
              # has won something
              return reverse('gift-shop')
          return reverse('spinner')
  </code></pre>