Django x Elasticsearch
Requirements
- Python > 3.7
- Django >= 3
- Elasticsearch 7.15
Setup Elasticsearch
Install via brew
-
Install
brew tap elastic/tap brew install elasticsearch
-
Running Elasticsearch
brew services start elasticsearch
Manual Installation
-
Download from https://www.elastic.co/downloads/elasticsearch
-
Extract file
$ tar -xvf elasticsearch-7.15.0-darwin-x86_64.tar.gz
-
[Optional] Change port This is an optional step, if need different multiple version of elasticsearch running in single machine:
$ nano config/elasticsearch.yml
- Uncoment/Add
http.port: 9201
-
Runing Elasticsearch:
$ bin/elasticsearch
Setup Apps
-
Installation
pip install -r requirements.txt
-
Runing Django
./manage.py migrate ./manage.py runserver
-
Rebuild Index Django
./manage.py search_index --rebuild