﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32989	my urls, views, and templates work, but view_on_site in the admin does not.	Malik A. Rumi	nobody	"I have a problem with view_on_site in the admin. I screwed up my app templates, and when I figured
out the problem and got them all fixed, I discovered that view_on_site was giving me the same
errors I had with my templates. But I have not been able to fix view_on_site. 

I have two theories:

    1. I have not been able to determine what template it is using (debug toolbar says None) or how
    it decides what template to use. It doesn't seem to work like the CBV. If I had that info,
    perhaps I could point it to my actual, working template.

    2. since get_absolute_url returns a leading '/', that screws up the call because my urls.py
    ends in a '/', which is how we are supposed to do it. 

Compare:
    https://docs.djangoproject.com/en/3.1/ref/contrib/sites/#getting-the-current-domain-for-full-urls
    and 
    https://code.djangoproject.com/ticket/27757#comment:5
    with 
    https://docs.djangoproject.com/en/3.1/topics/http/urls/#example

    Thus view_on_site is actually calling ""mysite.com/ktab/entry//admin/r/7/3509/"" or
    ""mysite.com/ktab/entry//half-hercules/"", and the extra slash - what you call a 'prefix',
    I think, is messing it up.

The error I am getting is:
        NoReverseMatch at /admin/r/7/3509/
        Reverse for 'EntryDetail_url' with keyword arguments
        '{'app_label': 'ktab', 'slug': 'half-hercules'}' not found. 1 pattern(s) tried:
        ['ktab/entry/(?P<slug>[-a-zA-Z0-9_]+)/$']

This is right and should work, just as it works with my url, view, and template, but since
view_on_site isn't really using those kwargs, I assume that is at least part of the problem.
But since the content type and object id are correct, I don't know where to go from here."	Uncategorized	closed	Uncategorized	3.1	Normal	invalid			Unreviewed	0	0	0	0	0	0
