Opened 8 years ago

Closed 8 years ago

Last modified 3 years ago

#8891 closed Uncategorized (fixed)

Tutorial part 2 should not tell to edit an admin.py file that doesn't exist.

Reported by: thegrandconjuration Owned by: nobody
Component: Documentation Version: 1.0
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

"Just one thing to do: We need to tell the admin that Poll objects have an admin interface. Edit the mysite/polls/admin.py file and add the following to the bottom of the file:"

No admin.py is created by python manage.py startapp polls. This should refer to 'mysite/polls/models.py'.

Attachments (1)

adding-admin.diff (763 bytes) - added by arien 8 years ago.
Patch to fix the apparently confusing instructions.

Download all attachments as: .zip

Change History (13)

comment:1 Changed 8 years ago by Jan Rademaker <j.rademaker@…>

Component: UncategorizedDocumentation
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

No, it should say something like "Create the file mysite/polss/admin.py and add ...". You don't store the admin specific stuff in models.py.

comment:2 Changed 8 years ago by thegrandconjuration

Owner: changed from nobody to thegrandconjuration
Status: newassigned

Ok, thanks for the clarification. I'm new to Django and was following the tutorial.

I put all the code there into the models.py and it worked, so I was assuming the documentation was in error.

All my other attempts at Django (including buying Practical Django Projects last month) went nowhere due to excessive documentation errors/incompatibilities. I was hoping 1.0 would be different and actually usable...

comment:3 Changed 8 years ago by thegrandconjuration

Wait, why did this thing just assign *me* the ticket? I only registered to post this...

comment:4 Changed 8 years ago by arien

Owner: changed from thegrandconjuration to nobody
Status: assignednew
Summary: error in part 2 of the Writing Your First Django App tutorialTutorial part 2 should not tell to edit an admin.py file that doesn't exist.
Triage Stage: UnreviewedAccepted

Changing the summary to describe what the issue.

Changed 8 years ago by arien

Attachment: adding-admin.diff added

Patch to fix the apparently confusing instructions.

comment:5 Changed 8 years ago by arien

Has patch: set

comment:6 Changed 8 years ago by Karen Tracey

#8932 reported this again.

comment:7 Changed 8 years ago by Jan Rademaker <j.rademaker@…>

Btw, as the admin.py file did not exist up to this point, it will be necessary to restart the development server. Might be worth noting.

comment:8 Changed 8 years ago by Karen Tracey

#8977 reports this again.

comment:9 Changed 8 years ago by speno

And do you also need to document how to get the newly created admin.py file included with the rest of your application? Just creating the file and restarting the server does not make it work. I assume it should be included someplace, but where?

comment:10 Changed 8 years ago by Karen Tracey

Restarting the server should do it. admin.autodiscover() loads the admin.py files for INSTALLED_APPS, and the tutorial already covers adding autodiscover() to urls.py:

http://docs.djangoproject.com/en/dev/intro/tutorial02/#activate-the-admin-site

comment:11 Changed 8 years ago by simon

Resolution: fixed
Status: newclosed

(In [9011]) Clarified the bit in the tutorial about creating your first admin.py - fixes #8891

comment:12 Changed 3 years ago by kid1000002000@…

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

has this been completed yet?

Note: See TracTickets for help on using tickets.
Back to Top