get app blog method

Hello, I’m new to Django, I’m currently creating a web project following a series of videos on You Tube but creating a blog app but when I go to filter the posts by category I get the error “The local variable ‘category’ cannot be accessed.” where it is not associated with a value. I use the get method to filter the categories. Could anyone give me a clue as to where the error could be?

Welcome @antonio-corraliza !

We’ll need to see the code in either the view or the model - wherever the error is occurring.

Note: When posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted.

1 Like