Answer the question
In order to leave comments, you need to log in
django-sphinx and flatpage
I'm trying to set up a search on FlatPage. To create a search field in the FlatPage model, I use the “monkey patching” technique, which I create in a separate file.
# -*- coding: utf-8 -*-
from djangosphinx.models import SphinxSearch
from django.contrib.flatpages.models import FlatPage
FlatPage.add_to_class('search', SphinxSearch(
index='article_index',
weights={
'title': 100,
'description': 30,
'tags': 80, })
$ ./manage.py generate_sphinx_config --all > /home/django/projects/optimed/etc/search_index/optimed_config.conf
Error: Unable to find any models in application which use standard SphinxSearch configuration.
$ ./manage.py ./manage.py generate_sphinx_config --all > /home/django/projects/optimed/etc/search_index/optimed_config.conf
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question