Code

Opened 6 years ago

Closed 6 years ago

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

Download all attachments as: .zip

Change History (13)

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

  • Component changed from Uncategorized to Documentation
  • 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 6 years ago by thegrandconjuration

  • Owner changed from nobody to thegrandconjuration
  • Status changed from new to assigned

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

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

comment:4 Changed 6 years ago by arien

  • Owner changed from thegrandconjuration to nobody
  • Status changed from assigned to new
  • Summary changed from error in part 2 of the Writing Your First Django App tutorial to Tutorial part 2 should not tell to edit an admin.py file that doesn't exist.
  • Triage Stage changed from Unreviewed to Accepted

Changing the summary to describe what the issue.

Changed 6 years ago by arien

Patch to fix the apparently confusing instructions.

comment:5 Changed 6 years ago by arien

  • Has patch set

comment:6 Changed 6 years ago by kmtracey

#8932 reported this again.

comment:7 Changed 6 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 6 years ago by kmtracey

#8977 reports this again.

comment:9 Changed 6 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 6 years ago by kmtracey

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

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:12 Changed 12 months ago by kid1000002000@…

  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized
  • UI/UX unset

has this been completed yet?

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.