Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics Final Details Step Detail View

Gul Asnani
Gul Asnani
15,138 Points

Urls after recreation

After adding steps in a course, it throws an error for the newly created steps. The older ones, that is, the ones written before adding this url, work perfectly fine!

1 Answer

Haydar Al-Rikabi
Haydar Al-Rikabi
5,971 Points

This is because you are not entering the right step pk in the url. Many people confuse the pk number with the "order" number. The pk number is not shown in the fields within the admin site. It is rather saved in the database.

To check the pk number of the newly created step:

  1. In the admin site, click on "steps".
  2. Click on any step in the list.
  3. You will see in your browser's address bar a url address that looks like this: http://127.0.0.1:8000/admin/courses/question/1/change/

The pk number is the one that comes before the word "change" in the end of the url.

Paulo Longino
Paulo Longino
5,017 Points

Thanks for the explanation it really helped me