[Answered ]-I am having troubles with a 404-error message from Django. It says "No location found matching the query"

2👍

The error message "No location found matching the query" suggests that the url pattern is correct, but there is no location with pk=1 in the database. You probably deleted it.

Try a different url e.g. /location/2/detail/ for a primary key that definitely exists.

You can find a primary key by doing something like Location.objects.first().id in the shell, or simply clicking on a location in the Django admin, and looking at the url.

Leave a comment