#29030: contrib.sites incorrectly documents its use in django.contrib.admin "View Site" functionality -------------------------------+-------------------------------------- Reporter: Kaleb Hornsby | Owner: nobody Type: Bug | Status: new Component: Documentation | Version: 2.0 Severity: Normal | Resolution: Keywords: | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 1 | UI/UX: 0 -------------------------------+--------------------------------------
Comment (by Kaleb Hornsby): Replying to [comment:4 Tim Graham]: > Is your suggestion to change the implementation of a81af7f49de7ff3f51f111de28ed3a682f67ea89 to use the sites framework instead of hardcoding '/'? I'm not exactly sure what case that would fix. If you're browsing a particular site like "www.example.com/admin/" wouldn't the site URL be "www.example.com", same as linking to "/"? Right now if you are hosting at `www.example.com` that is accessible to the internet, and you have a `admin.example.com` that is not publicly accessible and in your settings, you have `SITE_ID = 1` and `sites.models.Site.objects.get_current().domain == 'www.example.com'` then when you are on the admin (at `https://admin.example.com/admin`) and you click on the "View on site" link for an object that defines its `get_absolute_url` method to return `'/things/1/'`, then you get redirected to `https://www.example.com/things/1`. If you click on the "View site" link, however, you get sent to `https://admin.example.com/`. Now I am not even sure if changing it to check if `sites` is installed and prepending the domain is desired behavior or not. Anybody can set `admin.site.site_url = sites.models.Site.objects.get_current().domain`. But when I was reading the documentation as linked in the ticket, I did get confused. It is highly likely that I am the only one to have confused "View on site" with "View site". But maybe not. I think that the two links should probably be consistent with each other by default, though. Thank you for taking the time to look at this ticket and inquiring more about the issue. -- Ticket URL: <https://code.djangoproject.com/ticket/29030#comment:5> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.3f8fa59c40b50d7a9cce9fcd591b50c3%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.