I have a view defined as follows:
u = reverse("ipsych_results", kwargs = {"ipsychcase_id": ipsychvisit_instance.ipsychvisit_id})
print(f'the url being passed to redirect is {u}')
return redirect(u)
It prints out:
the url being passed to redirect is /ipsych/processed/8b429f6d-8538-4af6-90b9-102168887e34/
When I enter http://localhost:8000/ipsych/processed/8b429f6d-8538-4af6-90b9-102168887e34/
into the browser, the subsequent view is generated correctly. However, when I click the Submit button that triggers POST (which prints out the above), I get the following error:
Page not found (404)
"/Users/a/Documents/websites/website/ipsych/processed" does not exist
Request Method: GET
Request URL: http://localhost:8000/ipsych/processed//
Raised by: django.views.static.serve
Why is the ipsychcase_id
getting lost?