diff --git a/README.md b/README.md index 9c14a34..44af5cd 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ## Introduction This Django application introduces a GlobalSearchView, designed to perform a global search across various models within the Django admin site. +![alt text](assets/main.png "Main Page") +![alt text](assets/results.png "Results Page") ## Features * Global Search: Enables searching across multiple models from a single query. @@ -19,7 +21,16 @@ Install with command `pip install django-admin-global-search`. ### Usage To use `django-admin-global-search` in your Django project, you need to update your models and URL configurations. -1. Add `admin_global_search` to your `INSTALLED_APPS` setting. +1. Add `admin_global_search` to your `INSTALLED_APPS` setting before `django.contrib.admin`. +```python +INSTALLED_APPS = [ + "admin_global_search", + "django.contrib.admin", + "django.contrib.auth", + "django.contrib.contenttypes", + ... +] +``` 2. Ensure your models have a `global_search_fields` attribute that specifies the fields to be included in the search. Example: ```python class Artist(models.Model): diff --git a/admin_global_search/templates/admin_global_search/results.html b/admin_global_search/templates/admin_global_search/results.html index 9209ae5..eaa06bd 100644 --- a/admin_global_search/templates/admin_global_search/results.html +++ b/admin_global_search/templates/admin_global_search/results.html @@ -25,6 +25,8 @@ {% endblock %} +{% block title %}Results for "{{ query }}" | {{ site_title|default:_('Django site admin') }}{% endblock %} + {% block content %}