PyCharm CE: Django Unexpected expression syntax

I am doing the following code using PyCharm and Django and I'm getting the unexpected expression syntax error at the very end for ('products':products)) and I'm not sure why.

from django.shortcuts import render from django.http import HttpResponse from .models import Product

def admin_console(request): products = Product.objects.all() return render(request, 'products/products_page.html', ('products': products))

It looks like you might have meant to pass a dictionary literal as the context argument to render. Dictionary literals must be enclosed in curly braces. You've enclosed it in parentheses.

('products': products)

Vs.

{'products': products}
Back to Top