Skip to content

Commit ce5459b

Browse files
shaibekohl
andauthored
Update en/extend_your_application/README.md
Accepted suggestion from @ekohl Co-Authored-By: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
1 parent 014855d commit ce5459b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

en/extend_your_application/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ We will start with adding a link inside `blog/templates/blog/post_list.html` fil
4141

4242
The `post_detail` part means that Django will be expecting a URL in `blog/urls.py` with name=post_detail
4343

44-
And how about `pk=post.pk`? `pk` is short for primary key, which is a unique name for each record in a database. Every Django model has a field which serves as its primary key, and whatever other name it has, it can also be referred to as "pk". Because we didn't specify a primary key in our `Post` model, Django creates one for us (by default, a field named "id" holding a number that increases by one for each record, i.e. 1, 2, 3) and adds it as a field to each of our posts. We access the primary key by writing `post.pk`, the same way we access other fields (`title`, `author`, etc.) in our `Post` object!
44+
And how about `pk=post.pk`? `pk` is short for primary key, which is a unique identifier for each record in a database. Every Django model has a field which serves as its primary key, and whatever other name it has, it can also be referred to as "pk". Because we didn't specify a primary key in our `Post` model, Django creates one for us (by default, a field named "id" holding a number that increases for each record, i.e. 1, 2, 3) and adds it as a field to each of our posts. We access the primary key by writing `post.pk`, the same way we access other fields (`title`, `author`, etc.) in our `Post` object!
4545

4646
Now when we go to http://127.0.0.1:8000/ we will have an error (as expected, since we do not yet have a URL or a *view* for `post_detail`). It will look like this:
4747

0 commit comments

Comments
 (0)