You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en/extend_your_application/README.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
{% set warning_icon = '<spanclass="glyphicon glyphicon-exclamation-sign"style="color: red;"aria-hidden="true"data-toggle="tooltip"title="An error is expected when you run this code!" ></span>' %}
2
+
1
3
# Extend your application
2
4
3
5
We've already completed all the different steps necessary for the creation of our website: we know how to write a model, url, view and template. We also know how to make our website pretty.
@@ -30,7 +32,7 @@ We will start with adding a link inside `blog/templates/blog/post_list.html` fil
30
32
31
33
{% raw %}We want to have a link from a post's title in the post list to the post's detail page. Let's change `<h1><a href="">{{ post.title }}</a></h1>` so that it links to the post's detail page:{% endraw %}
@@ -53,7 +55,7 @@ We want our first post's detail to be displayed at this **URL**: http://127.0.0.
53
55
54
56
Let's make a URL in the `blog/urls.py` file to point Django to a *view* named `post_detail`, that will show an entire blog post. Add the line `url(r'^post/(?P<pk>\d+)/$', views.post_detail, name='post_detail'),` to the `blog/urls.py` file. The file should look like this:
Copy file name to clipboardExpand all lines: en/python_introduction/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
{% set warning_icon = '<spanclass="glyphicon glyphicon-exclamation-sign"aria-hidden="true"style="color: red;"></span>' %}
1
+
{% set warning_icon = '<spanclass="glyphicon glyphicon-exclamation-sign"style="color: red;"aria-hidden="true"data-toggle="tooltip"title="An error is expected when you run this command!"></span>' %}
We got our first error! The {{ warning_icon }} icon is our way of giving you a heads up that errors are expected in the command you're about to run. We all make mistakes and they're an important part of learning!
147
+
We got our first error! The {{ warning_icon }} icon is our way of giving you a heads up that the code you are about to run won't work as expected. Making mistakes (even intentional ones) are an important part of learning!
148
148
149
149
It says that objects of type "int" (integers, whole numbers) have no length. So what can we do now? Maybe we can write our number as a string? Strings have a length, right?
150
150
@@ -502,7 +502,7 @@ You can give Python as many numbers to compare as you want, and it will give you
502
502
503
503
Have you heard of the expression "comparing apples to oranges"? Let's try the Python equivalent:
Remember: The `print` function is indented four spaces within the `if` statement. This is because the function runs when the condition is met. Let's see how it works now:
0 commit comments