1
0
mirror of https://gitlab.com/animath/si/plateforme-corres2math.git synced 2025-06-21 18:38:24 +02:00

Use Django-Haystack to make indexed researches

This commit is contained in:
Yohann D'ANELLO
2020-10-15 12:57:20 +02:00
parent b397d00011
commit 6c59bf11be
7 changed files with 90 additions and 1 deletions

View File

@ -54,6 +54,7 @@ INSTALLED_APPS = [
'crispy_forms',
'django_extensions',
'django_tables2',
'haystack',
'logs',
'mailer',
'polymorphic',
@ -181,6 +182,13 @@ CRISPY_TEMPLATE_PACK = 'bootstrap4'
DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap4.html'
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
'PATH': os.path.join(os.path.dirname(__file__), 'whoosh_index'),
}
}
_db_type = os.getenv('DJANGO_DB_TYPE', 'sqlite').lower()
if _db_type == 'mysql' or _db_type.startswith('postgres') or _db_type == 'psql':

View File

@ -26,6 +26,7 @@ urlpatterns = [
path('admin/doc/', include('django.contrib.admindocs.urls')),
path('admin/', admin.site.urls, name="admin"),
path('accounts/', include('django.contrib.auth.urls')),
path('search/', include('haystack.urls')),
path('api/', include('api.urls')),
path('participation/', include('participation.urls')),