ESoft
ESoft

Reputation: 862

Model does not appear in admin page

I have seen this question many times, but none of them answer my question.
I have added an app and its models, but don't see them in the admin portal.
I can access the model from shell.

settings.py

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
    'myApp',
)

urls.py

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'RCOSPortal.views.home', name='home'),
    # url(r'^RCOSPortal/', include('RCOSPortal.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)

admin.py

from django.contrib import admin
from myApp.models import Owner

admin.site.register(Owner)

Upvotes: 0

Views: 168

Answers (1)

Siva Arunachalam
Siva Arunachalam

Reputation: 7740

  • Make sure that you have run the 'syncdb' command.
  • Create a OwnerAdmin and try to register it.
  • If not working upload your test project (including all files) in github, so that we could help you.

Upvotes: 1

Related Questions