Category: 2. Admin

  • Update Objects

    Once a model is registered with Django’s Admin app, we can easily perform CRUD operations on the model. In the previous chapter, we learned to register the Employee model. The homepage of admin site shows it under the MYAPP section − Display The List of Objects To display the list of objects, click on the name − Add…

  • Set Fields to Display

    When a model is registered to Django’s Admin site, its list of objects is displayed when you click the name of the model. In the following figure, the list of objects in the Employees model is displayed − However, the above page shows the objects in the form Employee object(1), which doesn’t reveal the attributes such as…

  • Include Models

    When a new project is initialized with the startproject command, Django automatically installs a few apps, the list of these apps can be found in the INSTALLED_APPS parameter of the project’s settings module. To be able to log into the admin site, the models – Groups and Users are automatically registered with the Admin site. Hence, as…

  • Create User

    The Django framework readily provides a robust user management system. The users, groups, and permissions are managed both through the admin interface as well as programmatically. When you create a new project with the startproject command, the admin and auth apps are added in the INSTALLED_APPS by default. All the user objects are stored in the “django.contrib.auth.models.User” model. Assuming that the project…

  • Admin Interface

    Django provides a ready-to-use user interface for administrative activities. We all know how an admin interface is important for a web project. Django automatically generates admin UI based on your project models. Starting the Admin Interface The Admin interface depends on the django.countrib module. To have it working you need to make sure some modules…