How to display pie chart using Django

2020-05-07 Thread ratnadeep ray
Hi all, I just started to work on Django and hence have limited knowledge about it. Now I need to design an app to display a pie chart based on some sample data. Can anybody please help me to do so? Is there any sample app existing which fulfills this requirement ? Thanks. -- You receive

django.core.exceptions.ImproperlyConfigured: error is coming

2020-05-08 Thread ratnadeep ray
I am new to Django and hence don't have much idea about it. I am trying to create an app having the following contents in my view.py file: from django.shortcuts import render > from fusioncharts.models import City > def pie_chart(request): > labels = [] > data = [] > queryset = City.o

How to push data fetched from excel to DB using Django?

2020-05-08 Thread ratnadeep ray
Hi all, Can anyone let me know how to push the fetched data from an excel to any DB using Django? -- 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-user

Re: How to push data fetched from excel to DB using Django?

2020-05-08 Thread ratnadeep ray
lease clarify these because I am pretty new to Django. Thanks. On Friday, 8 May 2020 18:27:43 UTC+5:30, Kasper Laudrup wrote: > > Hi Ratnadeep, > > On 08/05/2020 14.03, ratnadeep ray wrote: > > Hi all, > > > > Can anyone let me know how to push the fetched data from a

Re: How to push data fetched from excel to DB using Django?

2020-05-08 Thread ratnadeep ray
Thanks Derek for this. On Friday, 8 May 2020 19:20:31 UTC+5:30, Derek wrote: > > If you can, use an existing app: > > https://github.com/wq/django-data-wizard > > > On Friday, 8 May 2020 14:57:43 UTC+2, Kasper Laudrup wrote: >> >> Hi Ratnadeep, >> >

How to display multiple pie charts based on multiple lists?

2020-05-12 Thread ratnadeep ray
Hi all, I have a requirement where I need to display multiple pie charts based on multiple lists. Currently, I am able to display one pie chart involving 2 lists. Below is the views.py code for the same: # Create your views here. from django.shortcuts import render def pie_chart(request):

Django foreign-key cannot assign must be a instance

2020-05-18 Thread ratnadeep ray
Hi all, I am trying to add a row in the DB using the following views.py: # Create your views here. > from django.shortcuts import render > from fusioncharts.models import Component,Report > import xlrd > def pie_chart(request): > labels = [] > data = [] > loc = ("C:\Django_apps\QRC_

Re: Django foreign-key cannot assign must be a instance

2020-05-19 Thread ratnadeep ray
n Fazrihady > http://aldianfazrihady.com > > Pada tanggal Sel, 19 Mei 2020 13.49, ratnadeep ray > menulis: > >> Hi all, >> >> I am trying to add a row in the DB using the following views.py: >> >> # Create your views here. >>> from django.shor

How to pass a variable to views from a template using href ?

2020-05-19 Thread ratnadeep ray
Hi all, My requirement is to pass a variable to the view from the template using href. For example, I have written the following line of code: SQL data So using the above line, can we send the value "SQL" clicking on the link of "SQL data" to the method "execute" written in the views? If

Reverse for 'display_data' not found. 'display_data' is not a valid view function or pattern name

2020-05-19 Thread ratnadeep ray
Hi all, I am getting the below error when I am trying to load the home page: Reverse for 'display_data' not found. 'display_data' is not a valid view function or pattern name My views.py file is as follows: > def home(request): > #query_results = QRC_DB.objects.all() > return render(re

Getting the except django.core.exceptions.ImproperlyConfigured while querying DB

2020-05-20 Thread ratnadeep ray
I am trying to fetch a few rows from the DB using the following code in my views.py: from django.http import HttpResponsefrom django.shortcuts import renderfrom fusioncharts.models import QRC_DB def display_data(request,component): query_results = QRC_DB.objects.get(component_name__contains=

How to retrieve the values from the context_process.py file to template?

2020-05-26 Thread ratnadeep ray
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 =

Re: How to retrieve the values from the context_process.py file to template?

2020-05-26 Thread ratnadeep ray
So for this we have to import the model of context_process ? -- 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+unsubscr...@googlegroups.com. To view t

Re: How to retrieve the values from the context_process.py file to template?

2020-05-26 Thread ratnadeep ray
So what should be the correction in my case? -- 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+unsubscr...@googlegroups.com. To view this discussion o

Can we use python related api's on the Django templates ?

2020-05-27 Thread ratnadeep ray
Hi all, Currently I am trying to print the type of a variable from the Django template html file as follows: The type of feature list report for version > {%type(version)%} is For the above, I am getting the following error: Invalid block tag on line 9: 'type(version)'. Did you forget

Reverse for 'process_data' not found. 'process_data' is not a valid view function or pattern name.

2020-06-24 Thread ratnadeep ray
Hi all, I am trying to direct the option selected from the dropdown in the index.html along with the value to the process_data method in the views.py. But now I am getting the following error when I am trying to load my index page: NoReverseMatch at /index/ Reverse for 'process_data' not fo

Reverse for 'process_data' not found. 'process_data' is not a valid view function or pattern name.

2020-06-24 Thread ratnadeep ray
Hi all, Any comment on this? -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit

Re: Reverse for 'process_data' not found. 'process_data' is not a valid view function or pattern name.

2020-06-24 Thread ratnadeep ray
So I need to add this also: urlpatterns = [ ... ... path('process_data/', views.process_data, name='process_data'), -- 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,

Re: Reverse for 'process_data' not found. 'process_data' is not a valid view function or pattern name.

2020-06-24 Thread ratnadeep ray
Hi Ogunsanya, I have added that line of code but still getting the same error. So what can be done next ? On Thursday, 25 June 2020 00:25:17 UTC+5:30, Ogunsanya Opeyemi wrote: > > > Yes > On Wednesday, June 24, 2020, ratnadeep ray > wrote: > >> So

Re: Reverse for 'process_data' not found. 'process_data' is not a valid view function or pattern name.

2020-06-25 Thread ratnadeep ray
UTC+5:30, Ogunsanya Opeyemi wrote: > > Also include in your URL before your urlpatterns > > app_name=yourappname > > > And in your template URL write > {% url 'yourappname:process_data' ver %} > > > > And if you still have issues send the update

Re: Reverse for 'process_data' not found. 'process_data' is not a valid view function or pattern name.

2020-06-26 Thread ratnadeep ray
Also include in your URL before your urlpatterns > > app_name=yourappname > > > And in your template URL write > {% url 'yourappname:process_data' ver %} > > > > And if you still have issues send the update you made and let me check. > > On Thursday,

How to pass values of drop down from html template to views in Django?

2020-06-26 Thread ratnadeep ray
I need to send the value of the selected option in a drop down to the views. My html code is as follows: > > Select version to compare with > {%for ver in version_list%} > **{{ver}} option>** > {% endfor %} > The above is giving me the following error: > Page not found (404) > Request Meth

How to display a line graph in Django?

2020-06-30 Thread ratnadeep ray
Hi all, I have wrote a python program to display the line graph as follows: import matplotlib.pyplot as plt x = [1,2,3] y = [2,4,1] plt.plot(x, y) plt.xlabel('x - axis') plt.ylabel('y - axis') plt.title('My first graph!') plt.show() Now I need to display the same via Dj