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(request, 'display_data.html')
>
> def display_data(request,component):
>     #query_results = QRC_DB.objects.all()
> return HttpResponse("You're looking at the component %s." % component)


My urls.py file under the app is as follows: 

from django.urls import path
from fusioncharts import views

urlpatterns = [
>         path('home/', views.home, name=''),
> ]


The urls.py file under the project is as follows: 

from django.contrib import admin
> from django.urls import path,include
> urlpatterns = [
>     path('admin/', admin.site.urls),
>     path('', include('fusioncharts.urls'))
> ]



And my html file (display_data) code is as follows : 

>
> {% block content %}
>   <h3>Display the test results</h3>
>   <div id="container" style="width: 75%;">
>     <canvas id="display-data"></canvas>
> <li><a href="{% url 'display_data' 'SQL' %}">SQL</a></li>
>   </div>
> {% endblock %}




Can anyone please help me to find out the mistake ? 

Thanks. 

 

 


-- 
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/31ce205c-b54c-484f-8928-350eb91178a6%40googlegroups.com.

Reply via email to