My applications do not appear when using custom AdminSite

I’m having a problem with a custom AdminSite - my applications are not visible in the admin index and are not available if I find a suitable URL to view their models. My problem is very similar to this: http://groups.google.com/group/django-users/browse_thread/thread/881feb7eef80853a , but this is like the opposite problem - the models are visible in the bundle, but my custom is not.

My project is called magic and it has an application. named nullt

Magic / admin.py:

from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User, Group
from django.contrib.auth.admin import UserAdmin, GroupAdmin 

class MagicAdmin(AdminSite):
    pass

admin_site = MagicAdmin()

admin_site.register(Group, GroupAdmin)
admin_site.register(User, UserAdmin)

Magic / nullt / admin.py

from magic.admin import admin_site
...
admin_site.register(Host, HostAdmin)
admin_site.register(Client, ClientAdmin)
...

Magic / urls.py

from django.conf.urls.defaults import * #@UnusedWildImport
from magic.admin import admin_site

urlpatterns = patterns('',
    (r'^admin/', include(admin_site.urls)),
)

PS I am using Django 1.2.2 installed with easy_install and Python 2.6.5 from Ubuntu 10.04 x86_64

+5
source share
1

urls.py:

from django.contrib import admin
admin.autodiscover()

django/contrib/admin/__init__.py:

def autodiscover():
    """
    Auto-discover INSTALLED_APPS admin.py modules and fail silently when
    not present. This forces an import on them to register any admin bits they
    may want.
    """

, .

+2

All Articles