Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError #8

Open
ChoiJunhee opened this issue Dec 9, 2020 · 1 comment
Open

KeyError #8

ChoiJunhee opened this issue Dec 9, 2020 · 1 comment

Comments

@ChoiJunhee
Copy link

It proceeded as the official djreservation document, but key Error occurs in the 170th line self.pk = kwargs.pop ('pk') of djreservationviews.py.

@morandanieli
Copy link

I encountered the same issue.
If you copied the demoapp, you should change the following line:
<a href="{% url 'myreservation' obj.pk %}" >{{obj}}</a>(index.html line 12)
to your own model view (named ExampleModel below).

First, in your model urls.py file create the following view (as in the demoapp):
re_path(r"create/(?P<pk>\d+)$", ExampleModelReservation.as_view(), name="create_example_model")Then, change the above line accordingly:
<a href="{% url 'create_example_model' obj.pk %}" >{{obj}}</a>(index.html line 12)

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants