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.
--
Ticket URL: <https://code.djangoproject.com/ticket/32989>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
Comment:
Hi, Please see TicketClosingReasons/UseSupportChannels for ways to get
help. If you confirm a bug in Django, feel free to reopen with an
explanation of why Django is at fault. Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/32989#comment:1>