Algolia DevCon
Oct. 2–3 2024, virtual.
Framework integration / Django

Upgrading the Django integration

Upgrading to v3

If you have been using AlgoliaSearch for Django v1 or v2, you can upgrade to v3 by running the following command:

1
pip install -U algoliasearch_django>=3.0

Version 3 includes these breaking changes:

1. Upgrade usage of Python API Client to 3.0.0

AlgoliaSearch for Django v3 uses version 3 of the Python API client.

  • If you used AlgoliaSearch for Django v1 or v2 without directly using the Python API client, you’re ready to use v3 of Algolia for Django.
  • If you used AlgoliaSearch for Django v1 or v2 and you directly used the Python API client directly, 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.

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?