#10944: Site app should be able to make absolute URLs.
-------------------------------------+-------------------------------------
     Reporter:  Jeremy Dunck         |                    Owner:
                                     |  Christopher Medrela
         Type:  New feature          |                   Status:  assigned
    Component:  contrib.sites        |                  Version:  1.0
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by André Cruz):

 * cc: André Cruz (added)


Comment:

 Seems like this would be a pretty useful feature to have, and one that I
 need.

 Is any one of those "hacks" blessed by the Django community? I'm doing
 this:


 {{{
 def handcraft_absolute_url(path):
     domain = Site.objects.get_current().domain
     scheme = 'https' if SESSION_COOKIE_SECURE else 'http'
     return '{scheme}://{domain}{path}'.format(domain=domain, path=path,
 scheme=scheme)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/10944#comment:20>
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/064.56d46a855ea74a25e5f7981d9147e708%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to