How to make the links generated on sitemap with https protocol instead of http - Python script (Django framework)

Viewed 14

I have a Python script (Django framework) it automatically generates links in sitemap but it only generates HTTP links, I want the links to be HTTPS

this is what sitemap.py have

    from django.contrib.sitemaps import Sitemap
from .models import Theme

class ThemeSitemap(Sitemap):
changefreq = 'weekly'
priority = 0.8
def items(self):
return Theme.objects.all().order_by('-id')

I tried to add

protocol = "https"

but it did not work

How can I fix that?

0 Answers
Related