Built in views how to change in django watson package.

50 views
Skip to first unread message

Salima Begum

unread,
Dec 8, 2020, 11:06:43 PM12/8/20
to django...@googlegroups.com
Hi all,

I am using the django watson package in my project. How to achieve to change built in views to change default template rendering and to search results in the home page.

This is url of django watson 


Please Help me out to achieve this, Thank you in advance,

Thanks
~Salima

Omkar Parab

unread,
Dec 9, 2020, 12:46:54 AM12/9/20
to django...@googlegroups.com
Here's the link for the built-in-views,

https://github.com/etianen/django-watson/wiki/Built-in-views

To return search results on the home page, you need to add your,

{℅ Url "your_home_namespace" ℅} 

in 

<form action="{℅ url 'your_home_namespace' ℅}"> 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMSz6bk2iK6X7sL25%3DDefbMxgcfzzokpW-T3yNoJgZp%3D8LN4jA%40mail.gmail.com.

Salima Begum

unread,
Dec 9, 2020, 4:06:55 AM12/9/20
to django...@googlegroups.com
Thank you @Omkar Parab, I have tried your suggestion. It is working but the only thing i want is how to show the result search list in the front end page in template. 

Please can you help me out in this also. 

Thanks
~Salima

Omkar Parab

unread,
Dec 9, 2020, 4:41:24 AM12/9/20
to django...@googlegroups.com
Here's the link for template tag 👇


This tag will return the searched list 👇

{% search_results search_entry_list %}


Here's the link for the frontend structure 👇


Front-end code 
<body>
        <h1> Search results {% if query %} for &ldquo;. {{query}}&rdquo;{% endif %}
       </h1>

        {% if search_results %}
        
            {% search_results search_results %} 
            
        {% else %}

            {% if query %}

                <p><em>There are no results to display.</em></p>

                <p><em>Try entering a less specific search term.</em></p>

            {% else %}

                <p><em>Please enter a query in the search form.</em></p>
            {% endif %}

        {% endif %}

    </body>

Salima Begum

unread,
Dec 9, 2020, 7:06:38 AM12/9/20
to django...@googlegroups.com
Hi Omkar parab , 
I have followed the suggested path but Still it is not giving the search results.
 what I have to write in views.py in home function.

Thanks
~salima


Omkar Parab

unread,
Dec 9, 2020, 7:50:46 AM12/9/20
to django...@googlegroups.com
I'm not familiar with the Django-Watson package. 

Maybe you missed some initial steps.

Go through this medium blog. you will get an idea. 👇


Reply all
Reply to author
Forward
0 new messages