JohnnyCash
JohnnyCash

Reputation: 1261

Django South, add new model

For some reason, when I add a new model and use Django South to sync the database by: /manage.py schemamigration myapp --auto and then the migrate line, I still can't see the model on the admin page. South does say that it added the model though.. so I'm not sure what's going on..

Any thoughts?

Upvotes: 0

Views: 1612

Answers (1)

Thomas
Thomas

Reputation: 11888

Just because you created the model and synced it, does not mean it gets added to the admin page automatically. You must create an admin.py file in your app directory that contains

from django.contrib import admin
from .models import MyModel

admin.site.register(MyModel)

and make sure you have admin.site.autodiscover() in your main urls.py

This should all be covered in the tutorial pages for Django. Go back and RTM.

Upvotes: 3

Related Questions