#25519: VIEW_SITE in django-admin shows wrong URL if site is not hosted at root!
----------------------------------+--------------------
Reporter: DheerendraRathor | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admin | Version: 1.9a1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
----------------------------------+--------------------
In django-admin `VIEW_SITE` should redirect to base of hosted site. If
site is not hosted at the root but at some other location, then still
`VIEW_SITE` redirects to absolute root of the site.
Example:
Suppose site is hosted at `http://example.com/mysite/` and I'm using
`SCRIPT_NAME` HTTP header in my proxy server. `{% url 'some_url' %}`
results into `/mysite/some/url/` which is correct. But `site_url` in
django admin is hardcoded to `/`.
Here is the relevant code snippet from
`django.contrib.admin.sites.AdminSite`
{{{#!python
# URL for the "View site" link at the top of each admin page.
site_url = '/'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25519>
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/059.48dd98cf46683cd706ec5955faeec13b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.