--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d2457503-b332-4f26-8f8a-cda32934419fo%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.com.
path('students/', include(students.urls),
This way you are telling Django to handover all the requests sent in with students/ to students urls.py in students directory. There is where you will handle this and other students related urls.
In urls.py of students app you should have as follow:
path('<slug:post>/', views.post_details_view, name='post_details'),
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.com.
One more thing. if your view code is indented exactly the way it is in the provided then you need to fix the indentation ofdef post_details_view(request, post):This should be under class SearchResultsViews()like this...class SearchResultsViews(ListView): model = Post template_name = 'Search.html' def get_queryset(self): query = self.request.GET.get('q') object_list = Post.objects.filter(Q(title__icontains=query)) return object_list def post_details_view(request, post): f = get_object_or_404(Post, slug=post) return render(request, 'post_details.html', {'f': f})
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bd9d5723-7eed-4334-9d6c-de5a076883ebo%40googlegroups.com.
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6bc99e96-0830-4e23-9482-cd4268c14329o%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALWCJq0c6t_h0P%2BrPGTWxsOFod8ZScZvcFQSDF8g2M7EXoKsow%40mail.gmail.com.