from django.http import HttpResponse
from django.shortcuts import render
from fusioncharts.models import QRC_DB
def display_data(request,component):
query_results = QRC_DB.objects.get(component_name__contains=component)
return HttpResponse("You're looking at the component %s." % component)
For the above, I am getting the following exception:
django.core.exceptions.ImproperlyConfigured: The included URLconf 'Piechart_Excel.urls' does not appear to have any patterns in it. If you see valid patterns in the file then the issue is probably caused by a circular import.
However whenever I am removing/commenting out the below line, the above exception disappears:
query_results = QRC_DB.objects.get(component_name__contains=component)
Can anyone say what can be going wrong here?
urls.py file under app is as follows:
from django.urls import path
from fusioncharts import views
urlpatterns
urlpatterns = [
path('push-data/', views.push_data, name='push-data'),
path('home/', views.home, name='home'),
path('display_data/<str:component>', views.display_data, name='display_data'),
]
The url under the main project is as follows:
from django.contrib import admin
from django.urls import path,include
urlpatterns
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('fusioncharts.urls'))
]
So please advise what's going wrong.