Getting Started with COPO Admin Tools
The Django administration interface (“admin”) is used to manage data and models in the COPO web application. Once models are created and populated, the admin interface provides an easy way to view and manage them.
Here are the steps to get started with it:
1. Setting Up the Admin Interface
Before you can use the Django admin interface, ensure that the project is configured correctly:
Admin app: Ensure that django.contrib.admin is included in the
INSTALLED_APPS setting in settings.py.
INSTALLED_APPS = [
...
'django.contrib.admin',
...
]
URLs: Ensure that the admin URLs are included in the project’s urls.py
file.
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('myapp/', include('myapp.urls')),
]
Superuser: Create a superuser account to access the admin interface
python manage.py createsuperuser
Follow the prompts to create a username, email and password.
3. Logging into the Admin Interface
Login: Use the superuser credentials you created earlier to log in. Enter
your username and password then, click the Log in button.
4. Using the Admin Interface
Once logged in, you will be directed to the Django Admin dashboard, which provides an overview of all registered models and available actions.
Admin dashboard overview
Site administration: This section lists all the models registered in the admin site. For example, if you registered the profile type model, it will appear here.
See the Registering Django models section for more information on registering models.
Groups and users: By default, Django includes models for managing users and groups.
Managing actions
Bulk actions: Perform actions on multiple profiles simultaneously, such as deleting multiple profiles.
Custom actions: Define custom actions for specific tasks.