See also ticket 21386
Rebased after #1953 got merged
I have a partially related question: I struggle to find real use cases for the ADMIN_FOR setting. Shouldn't we deprecate it and assume we are documenting the current site?
I think the reasoning behind the ADMIN_FOR is that a single admin backend can handle multiple frontends; thus multiple SITE_IDs and multiple settings configurations in ADMIN_FOR. However I think that axing this feature should be discussed further on the mailing list for record keeping.
OK, I'll write to the -dev ML to get some more opinions.
No feedback until now, so I'd be in favor of simply removing ADMIN_FOR and related functionality. Are you willing to update the patch consequently?
I'm all for removing ADMIN_FOR, but it's not within the scope of this PR. This is specifically for the sites framework. If I have some additional time on my hands I could provide an additional PR.
If you remove ADMIN_FOR, you completely remove the need to use contrib,sites in admindocs, right?
Ah yes, you're right. So no deprecation of the feature then?
No deprecation (no existing code will crash anyway), but a note in the backwards incompatibility section of the release notes.
@claudep pushing my changes so far to get some feedback; is this what you intended? get_current_site could even be dropped, but that also requires some changes to the templates where the site instance is being used.
Yes, it is in the right direction. Indeed, I'd go even further, because the views_by_site stuff in view_index.html template does not make any more sense.
View functions are now grouped by namespace; previously they were grouped by site and I think the namespace is a good view group categorization. The patch now separates admindocs completely from the sites framework. I will look into creating tests for the changes.
Great, nice idea!
Rebased and squashed.
I think this line could also be removed.
Not a big deal, but the usage is to import from django.conf import settings
from django.conf import settings
Fixed #21386 -- admindocs depend on sites framework
* Removed ADMIN_FOR setting and warn warning
* Group view functions by namespace instead of site
* Added a test verifying namespaces are listed
Thanks to Claude Paroz for reviewing and ideas for improvement.
Thanks for the review, the issues have been resolved.
Thanks. Did you mean to add more tests (as of one of your comments above) or do you consider it ready for merge?
If it could get merged as-is, then I'd rather have it merged. Do you think
it should have more tests?
Thanks Bouke, committed in a39d672