0

I'm working on Project 1 Wiki.

I've independently got the entry and search functions to work, entry works by itself and search works by itself. If un-comment the code related to entry, search breaks. The search no longer redirects to the individual pages, nor the search results with matching substrings. Instead it will just redirect to and address like this http://127.0.0.1:8000/search?q=CSS. I know the search?q= is causing that to fail, but I don't see how to fix it.

enter image description here enter image description here enter image description here

enter image description here

0

I ended up adding 2 urlpatterns at the end. I've spent the last 45 minutes reading tutorials and still not clear what the difference between the last two entries in my list and why I needed both.

urlpatterns = [
    path("", views.index, name="index"),
    path("search", views.search, name="search"),
    path("str:<title>", views.entry, name="entry"),
    path("<str:title>", views.entry, name="entry")
]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .