Eric Acevedo
Eric Acevedo

Reputation: 1222

Django App not showing in admin after installing django 1.9

After installing django 1.9 I'm having problems trying to show my apps in the Admin interface, this is my code:

app name: people

#models.py:

from django.db import models

class Person(models.Model):
    name = models.CharField(max_length=100)
#admin.py:
from django.contrib import admin
from .models import Person

admin.register(Person)
#apps.py
from django.apps import AppConfig

class PeopleConfig(AppConfig):
    name = 'people'
#settings.py:
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'people'
]

I changed the last line of INSTALLED_APPS to 'people.apps.PeopleConfig' without success. Python version 3.5

Upvotes: 5

Views: 874

Answers (1)

Eric Acevedo
Eric Acevedo

Reputation: 1222

I found the problem

#Change:
admin.register(Person)
#To this:
admin.site.register(Person)

Sorry.

Upvotes: 5

Related Questions