-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
made 127.0.0.1 references links #219
Changes from 5 commits
f15ad73
6f918c3
eca555d
6f560db
862e3aa
22ba32c
3358097
7f2ac42
af2aea1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,7 @@ You need to be in the directory that contains the `manage.py` file (the `djangog | |
|
||
Now all you need to do is check that your website is running - open your browser (Firefox, Chrome, Safari, Internet Explorer or whatever you use) and enter the address: | ||
|
||
http://127.0.0.1:8000/ | ||
http://127.0.0.1:8000/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the first time that |
||
|
||
The web server will take over your command prompt until you stop it: to type more commands either open a new terminal window (and don't forget to activate your virtualenv in it too), or stop the web server by switching back to the window in which it's running and pressing CTRL+C - Control and C buttons together (on Windows, you might have to press Ctrl+Break). | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ Your `mysite/urls.py` file should now look like this: | |
url(r'', include('blog.urls')), | ||
) | ||
|
||
Django will now redirect everything that comes into `http://127.0.0.1:8000/` to `blog.urls` and look for further instructions there. | ||
Django will now redirect everything that comes into http://127.0.0.1:8000/ to `blog.urls` and look for further instructions there. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one does not need to be made clickable since we're not asking the user to visit it (only explaining how URL routing works). |
||
|
||
## blog.urls | ||
|
||
|
@@ -81,7 +81,7 @@ As you can see, we're now assigning a `view` called `post_list` to `^$` URL. But | |
- `^` in regex means "the beginning"; from this sign we can start looking for our pattern | ||
- `$` matches only "the end" of the string, which means that we will finish looking for our pattern here | ||
|
||
If you put these two signs together, it looks like we're looking for an empty string! And that's correct, because in Django url resolvers, `http://127.0.0.1:8000/` is not a part of URL. This pattern will show Django that `views.post_list` is the right place to go if someone enters your website at the `http://127.0.0.1:8000/` address. | ||
If you put these two signs together, it looks like we're looking for an empty string! And that's correct, because in Django url resolvers, http://127.0.0.1:8000/ is not a part of URL. This pattern will show Django that `views.post_list` is the right place to go if someone enters your website at the http://127.0.0.1:8000/ address. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here: I think we can leave it as-is since we're not expecting the user to visit those links. |
||
|
||
Everything all right? Open http://127.0.0.1:8000/ in your browser to see the result. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ Time to explain the mysterious `{% url 'blog.views.post_detail' pk=post.pk %}`. | |
|
||
Now when we go to: | ||
|
||
http://127.0.0.1:8000/ | ||
http://127.0.0.1:8000/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need this URL to be its own paragraph. I would rewrite the surrounding paragraph to put the URL inline: "Now when we go to http://127.0.0.1:8000/, we will have an error..." |
||
|
||
we will have an error (as expected, since we don't have a URL or a *view* for `post_detail`). It will look like this: | ||
|
||
|
@@ -69,7 +69,7 @@ That means if you enter `http://127.0.0.1:8000/post/5/` into your browser, Djang | |
|
||
Ok! Let's refresh the page: | ||
|
||
http://127.0.0.1:8000/ | ||
http://127.0.0.1:8000/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here: inline the URL into the sentence |
||
|
||
Boom! Yet another error! As expected! | ||
|
||
|
@@ -109,7 +109,7 @@ Near other `from` lines. And at the end of the file we will add our *view*: | |
|
||
Yes. It is time to refresh the page: | ||
|
||
http://127.0.0.1:8000/ | ||
http://127.0.0.1:8000/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here: inline the URL into the sentence |
||
|
||
![Post list view](images/post_list2.png) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need for the 4 spaces here.