Models are not visible in Django's admin interface automatically. You must activate a model for it to be accessible from the admin interface. The admin interface provides an easy way to add and edit objects in the model. However, it is not necessary to activate all or any models for Django to function.
The Admin class must be added to the model to activate the model in the admin interface. Only a simple Admin class is required:
class Admin: pass
Specific items that can be defined in the Admin class will be discussed in Hour 17, "Customizing Models in the Admin Interface."
Try It Yourself: Activate the People Model in the Admin InterfaceIn this section, you activate the People application you created in Hour 2 to make it accessible in the admin interface.
Did you Know? You don't have to stop the Django server and log in again to the admin interface to allow the Django admin to access a model that has been activated. All you need to do is refresh the web browser within the admin interface. |