1
I made a homepage using Jango, I am loading my slides and menus dynamically and it was perfect. I put both the menu and the footer through include and it worked 100%.
Now I came across a problem, the menu of products loaded on the main page when I click on it is directed to a specific page of that product, it perfectly takes the product data and everything else, the only problem is that the loading of the products inside my menu, even being in the include it loses the data, as I solve it ?
view py.
def list_product(request, template_name='home/index.html'):
# product = Product.objects.all()
product = Product.objects.filter(status='True')
products = {'list_products': product}
return render(request, template_name, products)
def about_product(request, pk, template_name='home/product.html'):
about_product = get_object_or_404(Product, pk=pk)
return render(request, template_name, {'about_product': about_product})
Hello, @Marcelolop3s. You can also show your template code?
– JonatasCD