Stuck on the Slug!


#1

I’m on Chapter 8 of the website’s tutorial pages at the end of the “Setting up the template” section. I have added all the code including the slug and when I run my server the same error occurs:

Reverse for ‘dream_detail’ with arguments ‘()’ and keyword arguments ‘{u’slug’: u’get-rich’}’ not found. 1 pattern(s) tried: [‘dreams/(/P[-\w]+)/$’]

I have absolutely no idea what this means.

Another thing that I do not understand is this:

When you have “slug” in your code, specifically “slug=thing.slug”, do I substitute the slug of my thing where you say slug? Or is this code word for word? There is another instance within the views.py file where you have “slug=slug”. Again, is this word for word, or do I substitute the slug of the page I am making?

Thanks for the help,

Joshua


#2

Reverse for ‘dream_detail’ with arguments ‘()’ and keyword arguments ‘{u’slug’: u’get-rich’}’ not found. 1 pattern(s) tried: [‘dreams/(/P[-\w]+)/$’]

In your admin, do you have an item with the slug “get-rich”?

I get this error when I automatically create links, and a link created doesn’t actually exist/won’t ever resolve, and then Django complains (I’d rather it throw a 404 error, but oh well.)

When you have “slug” in your code, specifically “slug=thing.slug”, do I substitute the slug of my thing where you say slug? Or is this code word for word? There is another instance within the views.py file where you have “slug=slug”. Again, is this word for word, or do I substitute the slug of the page I am making?

If I am remembering the piece of code right, then you do the close word for word. Can you paste in the code you mean and I’ll make sure I’m remembering correctly?


#3

Thank you. I have been working on a new project tonight and got it all figured out. I think I had missed a small step somewhere prior, which was creating the problem I was having.


#4

Yay, glad you got it figured out!