Skip to content

Commit

Permalink
settings: move whoosh index to a permanent storage
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jun 20, 2023
1 parent 7f3d397 commit 1d4d43a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
17 changes: 9 additions & 8 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,6 @@
},
}

# Search Backend
HAYSTACK_CONNECTIONS = {
"default": {
"ENGINE": "haystack.backends.whoosh_backend.WhooshEngine",
"PATH": os.path.join(ROOT_DIR, "whoosh_index"),
},
}

# Environment, sets the type of env of the app (PROD, DEV…)
COMMU_ENVIRONMENT = os.getenv("COMMU_ENVIRONMENT", "PROD")
COMMU_PROTOCOL = "https"
Expand Down Expand Up @@ -263,6 +255,15 @@

DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"

# Search Backend
# ------------------------------------------------------------------------------
HAYSTACK_CONNECTIONS = {
"default": {
"ENGINE": "haystack.backends.whoosh_backend.WhooshEngine",
"PATH": f"{AWS_S3_ENDPOINT_URL}/whoosh_index",
},
}

# Forum - Machina settings
# ------------------------------------------------------------------------------
MACHINA_FORUM_NAME = "La Communauté"
Expand Down
9 changes: 9 additions & 0 deletions config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@
"PASSWORD": os.getenv("POSTGRES_PASSWORD"),
}
}

# Search Backend
HAYSTACK_CONNECTIONS = {
"default": {
"ENGINE": "haystack.backends.whoosh_backend.WhooshEngine",
"PATH": os.path.join(ROOT_DIR, "whoosh_index"), # noqa F405
},
}

# Emails in Mailhog
# ------------------------------------------------------------------------------
EMAIL_HOST = "0.0.0.0"
Expand Down

0 comments on commit 1d4d43a

Please sign in to comment.