mirror of
				https://gitlab.com/animath/si/plateforme-corres2math.git
				synced 2025-11-04 07:42:14 +01:00 
			
		
		
		
	Use Django-Haystack to make indexed researches
This commit is contained in:
		@@ -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':
 | 
			
		||||
 
 | 
			
		||||
@@ -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')),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user