Reverse for 'process_data' not found. 'process_data' is not a valid view function or pattern name.
<html lang="en">
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
<title>Home</title>
</head>
<body>
<center>
<h3>Index page</h3>
<table align='center'>
<tr><td>Select the version to compare with</td><td>
<select name="version" id="version" onchange="location = this.value;">
<option>Select version to compare with</option>
{%for ver in version_list%}
<option value={{ver}} href="{% url 'process_data' ver %}">{{ver}}</option>
{% endfor %}
</select>
</td></tr>
<tr><td>The current version</td><td>{{version}}</td>
</tr>
</table>
<br><br><br>
</body>
</html>
def index(request): #query_results = QRC_DB.objects.all() global percentage_variation percentage_variation = 0 global version version = None context = RequestContext(request) response_context = get_result(request) #print("The response_context values = \n %s" %response_context.get("get_result")) cursor = connection.cursor() cursor.execute("select version from fusioncharts_qrc_db group by version") rows = cursor.fetchall() #print("The fetched rows =\n") #print(rows) version_list = [] #print(version_list) for ver in rows: version = str(ver).split("'")[1] version_list.append(version)
print("The final version list = %s" %version_list) return render(request, 'index.html', { 'version': version, 'version_list': version_list, })
def process_data(request,ver):
print("==============The version selected = %s===========" %ver)
return render(request, 'display_data.html', {
'version': version,
})
from django.urls import path
from fusioncharts import views
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'),
path('index/', views.index, name='index'),
]
from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('fusioncharts.urls'))
]
Any comment on this?
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/852e2f1b-fcfc-43a9-b098-9170579a8f56o%40googlegroups.com.
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, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5c62826f-a652-43c3-a89e-29cf1855a9f8o%40googlegroups.com.
Yes
On Wednesday, June 24, 2020, ratnadeep ray <ratna...@gmail.com> wrote:
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, send an email to django...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5c62826f-a652-43c3-a89e-29cf1855a9f8o%40googlegroups.com.
--OGUNSANYA OPEYEMI
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb999e9e-5fd9-45ec-9a59-86e3ed9b6454o%40googlegroups.com.
from django.urls import path
from fusioncharts import
views
app_name = 'fusioncharts'
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'),
path('index/', views.index, name=''),
path('process_data/<str:ver>', views.process_data, name='process_data'),
]
<html lang="en">
<head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
<title>Home</title>
</head>
<body>
<center>
<h3>Index page</h3>
<table align='center'>
<tr><td>Select the version to compare with</td><td>
<select name="version" id="version" onchange="location = this.value;">
<option>Select version to compare with</option>
{%for ver in version_list%}
<option value={{ver}} href="{% url 'fusioncharts:process_data' ver %}">{{ver}}</option>
{% endfor %}
</select>
</td></tr>
<tr><td>The current version</td><td>{{version}}</td>
</tr>
</table>
<br><br><br>
</body>
</html>
Page not found (404)
Request Method: GET Request URL: http://127.0.0.1:8000/index/11.5.1.18900-96
http://127.0.0.1:8000/index/11.5.1.18900-97
Using the URLconf defined in Piechart_Excel.urls, Django tried these URL patterns, in this order:
admin/
push-data/ [name='push-data']
home/ [name='home']
display_data/<str:component> [name='display_data']
index/
process_data/<str:ver> [name='process_data']
The current path, index/11.5.1.18900-96, didn't match any of these.
Can you suggest now what's going wrong ?
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb999e9e-5fd9-45ec-9a59-86e3ed9b6454o%40googlegroups.com.
--OGUNSANYA OPEYEMI
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/14aca6b8-8bc9-455a-b3c6-de0c8740a9a7o%40googlegroups.com.
<tr><td><a href="{% url 'process_data' ver1 %}">{{ver}}</a></td></tr>
<option value={{ver}} href="{% url 'process_data' ver %}">{{ver}}</option>
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bb999e9e-5fd9-45ec-9a59-86e3ed9b6454o%40googlegroups.com.
--OGUNSANYA OPEYEMI
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/db746050-5807-4b00-847f-3c3077faccb2o%40googlegroups.com.