Using the Django admin site
Django makes it easy to use the admin site right out of the box. In order to use this feature, we need to add an app to the settings.py
file and register a URL pattern to handle any project's admin links. By default, these settings should already exist in the code when a project is created using the startproject
command or by using the IDE. However, some tools and versions may generate code slightly differently and so it is always good to just double-check that these settings are configured in this way.
Activating the Django admin site
To make sure the Django admin site is activated in your project, follow these steps:
- In the main
settings.py
file, add the following app to theINSTALLED_APPS
variable and make sure this is at the top of the list:# /becoming_a_django_entdev/settings.py ... INSTALLED_APPS = [ 'django.contrib.admin', ... ]
- If the
/chapter_6/urls.py
file does not...