On Wed, Sep 9, 2009 at 4:33 AM, Vlastimil Zima <[email protected]> wrote:
>
> Hello,
> I found out, that if I made derived class of
> django.contrib.admin.sites.AdminSite admin generated by this AdminSite
> in unable to to create correct links e.g. for Logout (http://
> 127.0.0.1:8000/admin/Nonelogout/), Change Password (http://
> 127.0.0.1:8000/admin/Nonepassword_change/), etc. (examples are from
> index page). I am not sure whether it is mistake at my site or
> somewhere else.
>
> Everything I changed since createproject and syncdb:
>
> - add 'django.contrib.admin' to INSTALLED_APPS
> - create sites.py :
>
> from django.contrib.admin.sites import AdminSite
>
> class TestAdminSite(AdminSite):
>   def get_urls(self):
>       """
>       So far call super.get_urls, prepared for extensions
>       """
>       urlpatterns = []
>       urlpatterns.extend( super(TestAdminSite, self).get_urls() )
>       return urlpatterns
>     def urls(self):
>       return self.get_urls()
>   urls = property(urls)
>
> admin_site = TestAdminSite()

You need to provide a name parameter to the constructor of your AdminSite
sub-class as described in the relevant Django 1.1 admin app documentation:

http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adminsite-objects
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#multiple-admin-sites-in-the-same-urlconf

>
> - generate admin in urls.py :
>
> from django.conf.urls.defaults import *
> from sites import admin_site
> urlpatterns = patterns('',
>   (r'^admin/', include(admin_site.urls)),
> )
>
> Although there are no registered models, it can be observed that links
> are not correct.
>
> Any idea how to solve this problem or confirm that it is a bug will be
> helpful.
>

-- 
Ramiro Morales
http://rmorales.net

--~--~---------~--~----~------------~-------~--~----~
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