Framework integration
/
Django
Jan 06, 2025
Upgrading the Django integration
Upgrading to v4
If you have been using AlgoliaSearch for Django v1, v2 or v3, you can upgrade to v4 by running the following command:
Copy
1
pip install -U algoliasearch_django>=4.0
Version 4 includes these breaking changes:
Supports from Python3.8 and Django4.0
1. Upgrade usage of Python API Client to 4.0.0
AlgoliaSearch for Django v4 uses version 4 of the Python API client.
- If you used AlgoliaSearch for Django v1, v2 or v3 without directly using the Python API client, you’re ready to use v4 of Algolia for Django.
- If you used AlgoliaSearch for Django v1, v2 or v3 and you directly used the Python API client, you need to update your code.
2. Remove usage of deprecated method clear_index
The method clear_index
was removed and replaced by clear_objects
to match the names found in the newer version of the Python API client.
Copy
1
2
3
4
5
6
- from algoliasearch_django import clear_index
+ from algoliasearch_django import clear_objects
- clear_index(model)
+ clear_objects(model)
Did you find this page helpful?