On Jul 23, 9:17 pm, James <[email protected]> wrote:
> Based some tutorials and code examples, I'm attempting to modify my
> admin page by adding "admin.py" in my project directory. However, the
> changes don't seem to make a lick of difference.
>
> This (http://www.webmonkey.com/tutorial/
> Install_Django_and_Build_Your_First_App#Check_your_head) implies that,
> by creating "admin.py" in the "djangoblog" directory (if the tutorial
> is followed verbatim) with the listed code, the "Auth" and "Sites"
> sections of the administration page would not show up. I also take
> that to mean, based on other documentation I've read, that these, and
> other models, can be rearranged in the admin interface as desired.
>
> However, I ran across this (http://docs.djangoproject.com/en/dev/ref/
> contrib/admin/#adminsite-objects) that makes me believe such ideas are
> in Django 1.1, rather than 1.0.2, which I am currently running. Is
> this correct?
>
> If the modification should be done in templates, let me know; I do
> think admin.py is the appropriate place for it, but I'm new to the
> community.
>
> Thank you,
>
> James

This is a very misleading tutorial, and I wouldn't recommend it.
However if you look at the bottom of the page you reference, it says
it was last updated last September - just at the time of the release
of Django 1.0. So nothing in it is intended only for version 1.1.

I don't know why they assume that putting a blank AdminSite in the
project folder would make other admin sections disappear (I presume
this i the bit that isn't making a 'lick of difference' - the code for
the blog app customisations seems correct). There's no reason why the
code as given would work at all, especially the completely pointless
empty subclassing of AdminSite.

You could make this work, though. The missing piece is linking up the /
admin/ url with the new AdminSite object. You'd need to do this in
your urls.py - at the top, add
    from djangodblog.admin import site as mysite
and in the list of urls change 'admin.site.root' to 'mysite.root'.

However, this won't allow you to change the ordering of applications
on that page. This isn't easily customisable.
--
DR.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to