#26079: add prefered/default protocol in the sites framework
-------------------------------+----------------------------
Reporter: xblitz | Owner: nobody
Type: New feature | Status: new
Component: contrib.sites | Version: master
Severity: Normal | Keywords: sites protocol
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+----------------------------
I think adding a prefered/default protocol in the sites framework would be
a great addition for generating full url's to django websites.
specially when generating url from action not coming from a request like
the sitemaps
[https://github.com/django/django/blob/master/django/contrib/sitemaps/__init__.py#L42
ping_google] that assumes the protocol to be http:
{{{
current_site = Site.objects.get_current()
url = "http://%s%s" % (current_site.domain, sitemap_url)
}}}
so we could have something like this instead:
{{{
current_site = Site.objects.get_current()
url = "%s://%s%s" % (current_site.protocol, current_site.domain,
sitemap_url)
}}}
and maybe even add a shortcut for the site's base url
--
Ticket URL: <https://code.djangoproject.com/ticket/26079>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.7204863c05d5a00c5519aed9c5dd5b00%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.