*my development environment is:*
*python3.4 32bit*
*django1.11.2*
*django-haystack2.6.1*
*pysolr3.6.0*

*when I run manage.py build_solr_schema command*
django raise a error:*TypeError: context must be a dict rather than 
Context.*

I look up the source code of haystack:

def build_context(self, using):
    backend = connections[using].get_backend()

    if not isinstance(backend, SolrSearchBackend):
        raise ImproperlyConfigured("'%s' isn't configured as a SolrEngine)." % 
backend.connection_alias)

    content_field_name, fields = backend.build_schema(
        connections[using].get_unified_index().all_searchfields()
    )
    return Context({
        'content_field_name': content_field_name,
        'fields': fields,
        'default_operator': constants.DEFAULT_OPERATOR,
        'ID': constants.ID,
        'DJANGO_CT': constants.DJANGO_CT,
        'DJANGO_ID': constants.DJANGO_ID,
    })


def build_template(self, using):
    t = loader.get_template('search_configuration/solr.xml')
    c = self.build_context(using=using)
    return t.render(c)


I thought the t.render(c) function cause the TypeError,the param maybe a 
dict,not a Context instance.


what should I do about this?


-- 
You received this message because you are subscribed to the Google Groups 
"django-haystack" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-haystack+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to