xaralis / django-static-sitemaps

Tool for generating sitemaps as static files to serve them from webserver instead of your Django application.
154 stars 73 forks source link

No way to change default protocol for relative URLs #41

Open oppianmatt opened 8 years ago

oppianmatt commented 8 years ago

Can't see how to change to https (which should be the default). It looks hardcoded:

    @staticmethod
    def normalize_url(url):
        if url[-1] != '/':
            url += '/'
        if not url.startswith(('http://', 'https://')):
            if url.startswith('/'):
                from django.contrib.sites.models import Site
                url = 'http://' + Site.objects.get_current().domain + url
            else:
                url = 'http://' + url
        return url
oppianmatt commented 8 years ago

If anyone else, you can set it via STATICSITEMAPS_URL but that means you don't use the sites framework since you need to set the full domain as well as.

xaralis commented 8 years ago

@oppianmatt You're right. Once again, PR with this feature will be gladly accepted. Improvement should be very easy to implement.