response_context = {
}

On Tuesday, May 26, 2020 at 2:26:35 PM UTC+1, ratnadeep ray wrote:
>
> Hi all, 
>
> I am trying to display the value from the context_process.py file to the 
> template. 
>
> The content of my context_process.py is as follows: 
>
> from fusioncharts.models import QRC_DB
> from django.db import connection
>
> def get_result(request):
>>     cursor  = connection.cursor()
>>     pattern = "%%"+TotalTime+"%%"
>>     cursor.execute("select * from fusioncharts_qrc_db")
>>     rows = cursor.fetchall()
>>     return {'get_result': rows}
>
>
> Then in the html template file, I am trying to display the variable 
> get_result as follows: 
>
> {% block content %}
>>   <h3> Result = </h3>
>>   <br>
>>   {{get_result}}
>>
>> {% endblock %}
>
>
> My template details in the settings.py is as follows: 
>
>  
>
>> TEMPLATES = [
>>     {
>>         .......
>>         'OPTIONS': {
>>             'context_processors': [
>>                 .........
>>                 'fusioncharts.context_processors.get_result',
>>             ],
>>         },
>>     },
>> ]
>
>
> My views.py file is as follows: 
>
> def home(request):
>>     context = RequestContext(request)
>>     response_context = {}
>>     return render(request, 'display_data.html',response_context)
>
>
>
> But when I am running that, it is not displaying anything in the web page. 
>
> Is there anything missing in my code? What is going wrong here? 
>
>
>
>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d452ffb6-fda3-4a5b-8cfd-a6bc1e5644d7%40googlegroups.com.

Reply via email to