django-static-sitemaps
django-static-sitemaps copied to clipboard
No way to change default protocol for relative URLs
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
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.
@oppianmatt You're right. Once again, PR with this feature will be gladly accepted. Improvement should be very easy to implement.