Opened 16 years ago
Closed 15 years ago
#10050 closed (fixed)
Documentation bug in tutorial / admin manual? 'AdminSite' object has no attribute 'urls'
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.0 |
Severity: | Keywords: | AdminSite urlconf | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This is with the released Django 1.0.2
On the tutorial page 2, you have the code snippet (for setting up URLConfs for the admin site):
urlpatterns = patterns('', # Example: # (r'^mysite/', include('mysite.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^admin/', include(admin.site.urls)), )
Yet admin.site.urls does not exist, so django produces an error page instead of the admin site login.
In the (startproject) auto-generated urls.py, there is:
urlpatterns = patterns('', # Example: # (r'^mysite/', include('mysite.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), # Uncomment the next line to enable the admin: (r'^admin/(.*)', admin.site.root), )
which works as expected.
The same bug is repeated in the admin site documentation at http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adminsite-objects
Thanks for all your great work, I *heart* Django.
cheers,
dustin.
Change History (10)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Yes, it was an oversight that we didn't mark it as new in 1.1. However, I think it speaks to a larger issue, we need to make the 1.0 and 1.0.X docs easily available online. If we need to maintain 2 separate sets of directions in the docs in quickly leads to a lot of doc bloat, and that's neither fair to the developer nor to the reader.
comment:3 by , 16 years ago
Yes, your larger issue is my 2nd problem noted above. It's always been intended to have "1.0" and "Development" both available, I believe (that's why there's a search radio button for each) -- but right now I think it hasn't been done yet. At first there wasn't much point/urgency since there was not much difference between the two. Now, though, it's getting to be necessary to have "1.0" really mean "1.0" (probably latest 1.0.X branch), not "Development".
Independent of that, it also would still be good to mark the changes as "new/changed in ...". Not with two set of directions (that is unmanageable) but just as a clue to readers that it's an area that has been recently changed.
comment:4 by , 16 years ago
Is there some problem with just having a static snapshot of the 1.0.2 docs, as well as the devel branch, online?
comment:5 by , 16 years ago
Not a problem, no, it just hasn't been set up yet. My understanding is that "1.0" online is supposed to track the latest doc on the 1.0.X branch, which is better than a static snapshot since you get doc clarifications/improvements that haven't necessarily made it into a 1.0.X release yet. To date it hasn't been a problem that 1.0.X wasn't actually out there on the website, since things hadn't diverged too much, and what was new in development was mostly additions, so it was clear that the "new in" stuff wouldn't work if you were using 1.0.X. This is the first thing that's been a change to doc that makes it no longer applicable to 1.0.X, so it's probably time to go actually set up the real "1.0" doc on the website (whatever that involves).
comment:8 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I'm going to call this fixed because:
- Separation between documentation for trunk and documentation for 1.0.x has been implemented in r10066
- In r9892 a note has been added to the relevant section of tutorial part 2 in trunk telling users handling of admin URLs has changed (useful for anybody that had read the tutorial before r9739 and is following it again)
comment:9 by , 15 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I just downloaded ver1.1 and am running the tutorial I got from the link http://docs.djangoproject.com/en/dev/intro/tutorial03/#intro-tutorial03
I don't see the answer to the issue in the above comments, because I am just getting into this. How early did the problem get into the tutorial page. Everything seemed fine until I started page/part 3. I can see this is a documentation issue, and probably really simple to fix. I just don't know how. Help!
1.) does Ver 1.1 use an Earlier version's tutorial?
2.) has the tutorial linked through /dev/... not been updated
comment:10 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
The text of the tutorial at /dev/
is correct for 1.1 and trunk. The text of the tutorial at /1.0/
is correct for 1.0. If you believe there is still an error, bring it up on the django-developers mailing list for discussion.
You are reading doc that was changed very recently (r9739) and trying to apply it to older code.
We have two problems here. First, it doesn't look like the doc changes for r9739 were flagged as new in development or 1.1, which would be a signal they might not apply to 1.0.1.
Second, I do not think we have available online a copy of the most up-to-date 1.0.X branch docs, which is what you want to be using when using 1.0.x code. It appears that the "1.0" docs are the same as "latest development". It seems the docs are starting to diverge enough that we need to get a copy of the "1.0" ones out there. In this particular case the 0.96 docs won't work for 1.0.x nor now will the docs for development.