[Answered ]-Unable to access context object in HTML page rendered in Django

1👍

i suppose the return statement of your Newsdetail view should look like this:

def Newsdetail(request, slug):
    news = get_object_or_404(News, slug=slug)
    return render(request, 'newsfront/news_detail.html', {'news':news})
👤Mehdi

Leave a comment