I’ve finished coding for the Django Djitney project. I’m finding that the Lines and Stations functionality all works as expected. When I try to select any option with stops, I get an error message such as:
# TemplateDoesNotExist at /stops/1/update
routes/stop_form.html
|Request Method:|GET|
| --- | --- |
|Request URL:|http://e516eba060c943f49396605ef5820830.cc-propeller.cloud/stops/1/update|
|Django Version:|3.1.4|
|Exception Type:|TemplateDoesNotExist|
|Exception Value:|routes/stop_form.html|
|Exception Location:|/usr/local/lib/python3.6/dist-packages/django/template/loader.py, line 47, in select_template|
|Python Executable:|/usr/bin/python3|
|Python Version:|3.6.9|
|Python Path:|['/home/ccuser/workspace/django-djitney-project', '/var/codecademy/runner_contexts/python', '/home/ccuser/workspace/django-djitney-project', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']|
|Server time:|Sun, 22 May 2022 01:10:05 +0000|
We definitely don’t have the stop_form.html in the routes folder, but the request isn’t even for localhost. Here is my code for updating the stop.
views.py
class UpdateStopView(UpdateView):
model = Stop
template = "routes/update_stop.html"
form_class = StopForm
urls.py
path("stops/<pk>/update", views.UpdateStopView.as_view(), name="update_stop"),
This is identical to how Line and Station look, and both of those are working. Is there something I’m missing here?