As of the newforms-admin merge, the IRC channel is seeing a sudden rush of folks who try the tutorial and complain because the admin doesn't work. And they're right, because as written the tutorial sets up the admin in such a way that it's never aware of any models being registered -- including the contrib models that already have admin classes.
Adding 'admin.autodiscover()' to the project's root URLConf fixes this; normally I'd just check in a quick change to the tutorial to indicate that this should happen, but it feels to me like the right thing to do here is instead tweak the project template so that line is in the default URLConf (but commented out like the rest of the admin stuff), at which point the tutorial can simply stay as-is.
Thoughts?
-- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."
> As of the newforms-admin merge, the IRC channel is seeing a sudden > rush of folks who try the tutorial and complain because the admin > doesn't work. And they're right, because as written the tutorial sets > up the admin in such a way that it's never aware of any models being > registered -- including the contrib models that already have admin > classes.
> Adding 'admin.autodiscover()' to the project's root URLConf fixes > this; normally I'd just check in a quick change to the tutorial to > indicate that this should happen, but it feels to me like the right > thing to do here is instead tweak the project template so that line is > in the default URLConf (but commented out like the rest of the admin > stuff), at which point the tutorial can simply stay as-is.
> Thoughts?
> -- > "Bureaucrat Conrad, you are technically correct -- the best kind of > correct."
On Sat, Jul 19, 2008 at 4:08 PM, James Bennett <ubernost...@gmail.com> wrote:
> Adding 'admin.autodiscover()' to the project's root URLConf fixes > this; normally I'd just check in a quick change to the tutorial to > indicate that this should happen, but it feels to me like the right > thing to do here is instead tweak the project template so that line is > in the default URLConf (but commented out like the rest of the admin > stuff), at which point the tutorial can simply stay as-is.
I agree that this is something that should be in the project template. However, we can't completely avoid changes to the tutorial text - the text about what needs to be uncommented will need to be tweaked slightly. A quick explanation in tutorial 3 of the purpose of the admin.autodiscover() would also be appropriate, IMHO.
On Sat, Jul 19, 2008 at 3:08 AM, James Bennett <ubernost...@gmail.com> wrote: > Adding 'admin.autodiscover()' to the project's root URLConf fixes > this; normally I'd just check in a quick change to the tutorial to > indicate that this should happen, but it feels to me like the right > thing to do here is instead tweak the project template so that line is > in the default URLConf (but commented out like the rest of the admin > stuff), at which point the tutorial can simply stay as-is.
We should do both -- many of these questions (especially early on) are going to be from people who're upgrading instead of starting anew (the dynamic might shift after 1.0 final).
> On Sat, Jul 19, 2008 at 3:08 AM, James Bennett <ubernost...@gmail.com> > wrote: > > Adding 'admin.autodiscover()' to the project's root URLConf fixes > > this; normally I'd just check in a quick change to the tutorial to > > indicate that this should happen, but it feels to me like the right > > thing to do here is instead tweak the project template so that line is > > in the default URLConf (but commented out like the rest of the admin > > stuff), at which point the tutorial can simply stay as-is.
> We should do both -- many of these questions (especially early on) are > going to be from people who're upgrading instead of starting anew (the > dynamic might shift after 1.0 final).
FYI there was a ticket opened last night that suggests both of these:
> Adding 'admin.autodiscover()' to the project's root URLConf fixes > this; normally I'd just check in a quick change to the tutorial to > indicate that this should happen, but it feels to me like the right > thing to do here is instead tweak the project template so that line is > in the default URLConf (but commented out like the rest of the admin > stuff), at which point the tutorial can simply stay as-is.
> Thoughts?
Yeah, I agree that this should be done. I originally took the stance that it might be an uncommon thing since most people might want a custom AdminSite instance, and boy was I wrong ;)
Tweaking the tutorial would be a good idea too. Give a bit of information about it would be a good thing.