Skip to content

Commit 22d8430

Browse files
committed
Prepare algolia.com's integration
1 parent ddfc427 commit 22d8430

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

README.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
<!--NO_HTML-->
12
Algolia Search for Django
23
==================
4+
<!--/NO_HTML-->
35

46
This package lets you easily integrate the Algolia Search API to your [Django](https://www.djangoproject.com/) project. It's based on the [algoliasearch-client-python](https://github.com/algolia/algoliasearch-client-python) package.
57

@@ -11,6 +13,7 @@ Compatible with **Python 2.7**, **Python 3.2+** and **Django 1.7+**
1113
[![Coverage Status](https://coveralls.io/repos/algolia/algoliasearch-django/badge.svg?branch=master)](https://coveralls.io/r/algolia/algoliasearch-django)
1214
[![PyPI version](https://badge.fury.io/py/algoliasearch-django.svg?branch=master)](http://badge.fury.io/py/algoliasearch-django)
1315

16+
<!--NO_HTML-->
1417
Table of Content
1518
-------------
1619
**Get started**
@@ -25,16 +28,15 @@ Table of Content
2528
1. [Options](#options)
2629
1. [Run Tests](#run-tests)
2730

31+
<!--/NO_HTML-->
2832

29-
Install
30-
-------------
33+
# Install
3134

3235
```sh
3336
pip install algoliasearch-django
3437
```
3538

36-
Setup
37-
-------------
39+
# Setup
3840

3941
In your Django settings, add `django.contrib.algoliasearch` to `INSTALLED_APPS` and add these two settings:
4042

@@ -51,8 +53,8 @@ There are two optional settings:
5153
* `INDEX_SUFFIX`: suffix all indexes. Use it to differenciate development and production environment, like `Location_dev` and `Location_prod`.
5254
* `AUTO_INDEXING`: automatically synchronize the models with Algolia (default to **True**).
5355

54-
Quick Start
55-
-------------
56+
57+
# Quick Start
5658

5759
Simply call `AlgoliaSearch.register()` for each of the models you want to index. A good place to do this is in your application's AppConfig (generally named `apps.py`). More info in the [documentation](https://docs.djangoproject.com/en/1.8/ref/applications/)
5860

@@ -88,13 +90,13 @@ class YourModelIndex(AlgoliaIndex):
8890

8991
And then replace `algoliasearch.register(YourModel)` with `algoliasearch.register(YourModel, YourModelIndex)`.
9092

91-
## Commands
93+
# Commands
9294

9395
* `python manage.py algolia_reindex`: reindex all the registered models. This command will first send all the record to a temporary index and then moves it.
9496
* `python manage.py algolia_applysettings`: (re)apply the index settings.
9597
* `python manage.py algolia_clearindex`: clear the index
9698

97-
## Search
99+
# Search
98100

99101
We recommend the usage of our [JavaScript API Client](https://github.com/algolia/algoliasearch-client-js) to perform queries directly from the end-user browser without going through your server.
100102

@@ -107,7 +109,7 @@ params = { "hitsPerPage": 5 }
107109
raw_search(Contact, "jim", params)
108110
```
109111

110-
## Geo-Search
112+
# Geo-Search
111113

112114
Use the `geo_field` attribute to localize your record. `geo_field` should be a callable that returns a tuple (latitude, longitude).
113115

@@ -188,11 +190,12 @@ class ContactIndex(AlgoliaIndex):
188190
should_index = 'is_adult'
189191
```
190192

191-
Run Tests
192-
-------------
193+
<!--NO_HTML-->
194+
# Run Tests
193195

194196
To run the tests, first find your Algolia application id and Admin API key (found on the Credentials page).
195197

196198
```shell
197199
ALGOLIA_APPLICATION_ID={APPLICATION_ID} ALGOLIA_API_KEY={ADMIN_API_KEY} tox
198200
```
201+
<!--/NO_HTML-->

0 commit comments

Comments
 (0)