Skip to content

testdrivenio/django-drf-elasticsearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django DRF Elasticsearch

Want to learn how to build this?

Check out the post.

Want to use this project?

  1. Fork/Clone

  2. Install Elasticsearch if you haven't already and make sure it is running on port 9200. Make sure to update the ELASTICSEARCH_DSL config in core/settings.py.

  3. Create and activate a virtual environment:

    $ python3.12 -m venv venv && source venv/bin/activate
  4. Install the requirements:

    (venv)$ pip install -r requirements.txt
  5. Apply the migrations:

    (venv)$ python manage.py migrate
  6. Populate the database with some test data by running the following command:

    (venv)$ python manage.py populate_db
  7. Create and populate the Elasticsearch index and mapping:

    (venv)$ python manage.py search_index --rebuild
  8. Run the server

    (venv)$ python manage.py runserver
  9. Test Elasticsearch with the following queries: