Skip to content
Advertisement

Reverse for ‘topic’ not found. ‘topic’ is not a valid view function or pattern name (another one)

I’m aware that there are quite a few similar posts like this one, but I still can’t figure it out. This is the code in the ‘topics’ template that links each individual ‘topic’ to it (also the code causing the error):

JavaScript

Error being:

JavaScript

Here is urls.py:

JavaScript

Here is the topic function in views.py:

JavaScript

Advertisement

Answer

Look at second path – you need name topic, not topics

JavaScript

And in views maybe with topic_id:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement