Wednesday, September 27, 2017

django.urls.exceptions.NoReverseMatch: Reverse for 'index' not found. 'index' is not a valid view function or pattern name.

i m a noob in django And i dont know why i am getting this error

my views.py file:
from django.shortcuts import render,render_to_response
from django.http import HttpResponse
from all.models import ALL
from django.template import RequestContext
# Create your views here.
def home(request):
return render(request, 'index.html', {'ne': ne})


def technology(request):
return HttpResponse('<body>hello</body>')

def index(request):
assert isinstance(request , HttpResponse)
return render(request, 'index.html') . 

my url file
    url(r'^$', all.views.index),
url(r'^technology', all.views.index),
url(r'^index$', all.views.home),
url(r'^admin/', admin.site.urls),
]

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/41876d02-56e0-48c8-8722-17fc08ed32f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment