I seem to be unable to pass in isbn10 numbers in to the Django.
<a href="{% url 'books-to-detail' fic.isbn %}">
<section class="slideshow-fiction">
<img src="{{ fic.image }}" alt="" />
<p>{{ fic.title|truncatewords:4 }}</p>
<!-- <p>{{ fic.description }}</p> -->
<p>{{ fic.author }}</p>
<!-- <p>{{ fic.isbn }}</p> -->
</section>
</a>
Examples of the numbers are 059318808X and 0316539562. I've tried to use re_path and regex however if i get one number to pass the other does not. This is one of the paths that I've tried but 0316539562 does not pass.
re_path(
r"^redirect/books/(?P<isbn>[0-9]*[-| ][0-9]*[-| ][0-9]*[-| ][0-9]*[-| ][0-9]*\w)/$",
redirect_books_to_detail,
name="books-to-detail",
),
The error here
Trying this url path
re_path(
r"^redirect/books/(?P<isbn>[\w\+%_& ]+)/$",
redirect_books_to_detail,
name="books-to-detail",
),
I now get an error that there is seen here