Skip to content

towhidulhaque/django-drf-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django DRF Elasticsearch

Two months back, at my Tech Talk session with BRAC IT, I showed a demo of Elasticsearch from an online tutorial, but it was cumbersome to some of you because of installation issues and others. Instead, participants preferred my way of doing all things on Docker. So I am uploading all my demo code here with everything in dockerized containers. I kept the models same as it is and uploaded the exact data generation script.

Want to use this project?

  1. Fork/Clone

  2. Install Docker & Docker-Compose

  3. Build:

    $ docker-compose build
  4. Run:

    $ docker-compose up -d
  5. Open web container's bash:

    $ docker-compose exec web bash
  6. Apply the migrations:

    root@container-id $ python manage.py migrate
  7. Populate the database with some test data by running the following command:

    root@container-id $ python manage.py populate_db
  8. Create and populate the Elasticsearch index and mapping:

    root@container-id $ python manage.py search_index --rebuild
  9. Test Elasticsearch with the following queries:

  10. Or if you familiar with swagger you can play with the following URL -

About

Simple demo of integrating Elasticsearch with DRF

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published