django ignoring admin.py

Posted by noam on Stack Overflow See other posts from Stack Overflow or by noam
Published on 2010-12-28T12:35:25Z Indexed on 2010/12/28 12:54 UTC
Read the original article Hit count: 576

Filed under:
|

I am trying to enable the admin for my app. I managed to get the admin running, but I can't seem to make my models appear on the admin page. I tried following the tutorial (here) which says:

(Quote)

Just one thing to do: We need to tell the admin that Poll objects have an admin interface. To do this, create a file called admin.py in your polls directory, and edit it to look like this:

from polls.models import Poll from
django.contrib import admin

admin.site.register(Poll)

(end quote)

I added an admin.py file as instructed, and also added the following lines into urls.py:

from django.contrib import admin

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

but it appears to have no effect. I even added a print 1 at the first line of admin.py and I see that the printout never happens, So I guess django doesn't know about my admin.py. As said, I can enter the admin site, I just don't see anything other than "groups", "users" and "sites". What step am I missing?

© Stack Overflow or respective owner

Related posts about django

Related posts about admin