https://github.com/algolia/algoliasearch-django-example
https://github.com/algolia/algoliasearch-django-example
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/algolia/algoliasearch-django-example
- Owner: algolia
- Created: 2015-06-18T13:04:48.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2021-03-05T09:47:46.000Z (over 5 years ago)
- Last Synced: 2025-04-25T11:53:14.984Z (about 1 year ago)
- Language: Python
- Size: 745 KB
- Stars: 24
- Watchers: 83
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AlgoliaSearch Django Example
This is a Django application indexing 500 `Contact` objects and providing auto-completion and instant-search samples. See [algoliasearch-django](https://github.com/algolia/algoliasearch-django) package.
A `Contact` is defined by:
* A name
* An email address
* A company name
An [Algolia](https://www.algolia.com) account is required to test it.
## Dependencies
```bash
$ pip install algoliasearch-django
```
## Installation
```bash
$ git clone https://github.com/algolia/algoliasearch-django-example
$ cd algoliasearch-django-example
$ python manage.py migrate
$ python manage.py createsuperuser
```
## Configure the credentials
You can add your credentials in `core/settings.py` or you can export them in your environment:
```bash
$ export ALGOLIA_APPLICATION_ID=XXXXX
$ export ALGOLIA_API_KEY=XXXXX
$ export ALGOLIA_SEARCH_API_KEY=XXXXX
```
## Populate the DB and start indexing
```bash
$ python manage.py loaddata contacts.json
$ python manage.py algolia_reindex
```
## Start the application
```bash
$ python manage.py runserver
```
Enjoy your `http://localhost:8000` examples!

