Opened 16 years ago

Closed 16 years ago

Last modified 11 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 16 years ago.
Patch to fix the apparently confusing instructions.

Download all attachments as: .zip

Change History (13)

comment:1 by Jan Rademaker <j.rademaker@…>, 16 years ago

Component: UncategorizedDocumentation

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 by thegrandconjuration, 16 years ago

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 by thegrandconjuration, 16 years ago

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

comment:4 by arien, 16 years ago

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.

by arien, 16 years ago

Attachment: adding-admin.diff added

Patch to fix the apparently confusing instructions.

comment:5 by arien, 16 years ago

Has patch: set

comment:6 by Karen Tracey, 16 years ago

#8932 reported this again.

comment:7 by Jan Rademaker <j.rademaker@…>, 16 years ago

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 by Karen Tracey, 16 years ago

#8977 reports this again.

comment:9 by speno, 16 years ago

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 by Karen Tracey, 16 years ago

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 by simon, 16 years ago

Resolution: fixed
Status: newclosed

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

comment:12 by kid1000002000@…, 11 years ago

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