[Django] #21386: admindocs 'views' section depends on SITE_ID setting

22 views
Skip to first unread message

Django

unread,
Nov 5, 2013, 5:39:32 AM11/5/13
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
---------------------------------------------+------------------------
Reporter: ramiro | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admindocs | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
It seems the admindocs views try to detect if th sited contrib app is
installed and avoid to use its features if it's not.

But in a couple of places it uses `settings.SITE_ID` and the new 1.6
default project template settings.py doesn't include it because the sites
framework isn't installed.

Perhaps it could be replaced by
'django.contrib.admindocs.models.get_current_site(request)` as suggested
by https://docs.djangoproject.com/en/1.6/ref/contrib/sites/#hooking-into-
the-current-site-from-views?

--
Ticket URL: <https://code.djangoproject.com/ticket/21386>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 5, 2013, 6:01:47 AM11/5/13
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
-----------------------------------+------------------------------------

Reporter: ramiro | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.admindocs | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by bmispelon):

* cc: bmispelon (added)
* stage: Unreviewed => Accepted


Old description:

> It seems the admindocs views try to detect if th sited contrib app is
> installed and avoid to use its features if it's not.
>
> But in a couple of places it uses `settings.SITE_ID` and the new 1.6
> default project template settings.py doesn't include it because the sites
> framework isn't installed.
>
> Perhaps it could be replaced by
> 'django.contrib.admindocs.models.get_current_site(request)` as suggested
> by https://docs.djangoproject.com/en/1.6/ref/contrib/sites/#hooking-into-
> the-current-site-from-views?

New description:

It seems the admindocs views try to detect if th sited contrib app is
installed and avoid to use its features if it's not.

But in a couple of places it uses `settings.SITE_ID` and the new 1.6
default project template settings.py doesn't include it because the sites
framework isn't installed.

Perhaps it could be replaced by

'django.contrib.sites.models.get_current_site(request)` as suggested by
https://docs.djangoproject.com/en/1.6/ref/contrib/sites/#hooking-into-the-
current-site-from-views?

--

Comment:

Yes.

This would also allow us to get rid of `admindocs.views.GenericSite` (it
seems it was used because `sites.models.RequestSite` hadn't been
implemented yet).

--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:1>

Django

unread,
Nov 5, 2013, 6:58:00 AM11/5/13
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
-----------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Uncategorized | Status: assigned
Component: contrib.admindocs | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by bouke):

* status: new => assigned
* owner: nobody => bouke
* has_patch: 0 => 1


Comment:

PR: https://github.com/django/django/pull/1871

--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:2>

Django

unread,
Nov 5, 2013, 6:59:00 AM11/5/13
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
-----------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Uncategorized | Status: assigned
Component: contrib.admindocs | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by bouke):

Hooking into `get_current_site` is not straight-forward as `admindocs` can
inspect multiple settings modules, and each can have their own `SITE_ID`
setting.

--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:3>

Django

unread,
Nov 5, 2013, 6:59:13 AM11/5/13
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
-----------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Uncategorized | Status: assigned
Component: contrib.admindocs | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by bouke):

* cc: bouke@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:4>

Django

unread,
Dec 18, 2013, 1:44:36 PM12/18/13
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
-----------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Uncategorized | Status: closed
Component: contrib.admindocs | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"a39d672ec7d53637805a61b45a51bc0e7d297a36"]:
{{{
#!CommitTicketReference repository=""
revision="a39d672ec7d53637805a61b45a51bc0e7d297a36"
Fixed #21386 -- Removed admindocs dependence 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.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:5>

Django

unread,
Dec 18, 2013, 1:47:45 PM12/18/13
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
--------------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Cleanup/optimization | Status: closed
Component: contrib.admindocs | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* type: Uncategorized => Cleanup/optimization


--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:6>

Django

unread,
Jan 12, 2014, 6:43:05 AM1/12/14
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
--------------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Cleanup/optimization | Status: closed
Component: contrib.admindocs | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by sthzg@…):

Is there a chance to backport this fix to one of the next 1.6.x minor
updates? This would leave existing 1.6 installations that don't need the
sitesframework completely supported and would allow for an easy update
path to solve the problem.

--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:7>

Django

unread,
Jan 12, 2014, 11:03:48 AM1/12/14
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
--------------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Cleanup/optimization | Status: closed
Component: contrib.admindocs | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by bouke):

By including `SITE_ID=None` in your settings, you should not encounter any
issues on 1.6. It would be good to provide a fix for 1.6, but backporting
the fix of 1.7 would introduce changes in the featureset. It might be
better to include installation instructions for admindocs noting that
`SITE_ID` should be configured.

--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:8>

Django

unread,
Jan 12, 2014, 3:10:17 PM1/12/14
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
--------------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Cleanup/optimization | Status: closed
Component: contrib.admindocs | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by anonymous):

That works perfectly on my setup. Thanks for the hint.

--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:9>

Django

unread,
Mar 21, 2014, 11:23:46 AM3/21/14
to django-...@googlegroups.com
#21386: admindocs 'views' section depends on SITE_ID setting
--------------------------------------+------------------------------------
Reporter: ramiro | Owner: bouke
Type: Cleanup/optimization | Status: closed
Component: contrib.admindocs | Version: master

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"cb47969cd7271749393998a21bc8c467088d6235"]:
{{{
#!CommitTicketReference repository=""
revision="cb47969cd7271749393998a21bc8c467088d6235"
Removed warning for settings.ADMIN_FOR which has been removed.

refs #21386.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21386#comment:10>

Reply all
Reply to author
Forward
0 new messages