developersociety / django-template

Django templates for DEV Django sites
6 stars 0 forks source link

Set wagtail search backend to be default postgres / database. #251

Closed danthedeckie closed 2 years ago

danthedeckie commented 2 years ago

Description

After various discussions, and now that the postgres / database backend is improved (wagtail 2.15?) we're now switching to that being the default, instead of default being elasticsearch.

Setup instructions

Include any environment variables etc. that are needed to test your code. Anything not specific to testing just this PR would be better in the README.

How to test

mktmpenv --python=python3.10
pip install cookiecutter
cookiecutter --no-input --checkout use-postgres-search-by-default gh:developersociety/django-template wagtail=y
cd projectname
nvm use
make npm-install pip-install-local
dropdb --if-exists projectname_django
createdb projectname_django
./manage.py migrate
make django-dev-createsuperuser
./manage.py update_index

and then to check that it works with the env var:

ENABLE_ELASTICSEARCH=1 ./manage.py update_index

and it should attempt to connect to elasticsearch and do that.

For comprehensive guidelines on code review at DEV, see here: https://www.notion.so/developersociety/Code-Review-f804361f9b6b4859bdcd69d7704168e5.