views:

213

answers:

2

I have a Django project with about 10 apps in it. But the admin interface only shows Auth and Site models which are part of Django distribution. Yes, the admin interface is up and working but none of my self-written apps shows there.

INSTALLED_APPS

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.sites',
    'django.contrib.contenttypes',
    'django.contrib.humanize',
    'django.contrib.sessions',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'project.app1',
    ...

app1/admin.py

from django.contrib import admin
from project.app1.models import *

admin.site.register(model1)
admin.site.register(model2)
admin.site.register(model3)

What could be wrong in this case? Looks like everything is configured as what document says.

Thank you in advance.

A: 

Which version of Django are you using? Support for files named admin.py was added in version 1.0 (I think). Before that, you'd have to add extra information to your model.

Zach Hirsch
@zach, i'm using latest django version from development trunk.
jack
A: 

If something in your app throws an exception, the app or model may be excluded from the admin on subsequent requests.

If that is the case, you should get an error on the first request.

Also, please make sure your URLCONF has admin.site.autodidcover()

knutin
yes admin.site.autodiscover() is the most important thing to check. this is the command which actually loads your admin.py files from the app directories.
Thomas