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

made 127.0.0.1 references links #219

Merged
merged 9 commits into from
Feb 10, 2015
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions django_admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Let's open the `blog/admin.py` file and replace its content with this:
As you can see, we import (include) the Post model defined in the previous chapter. To make our model visible on the admin page, we need to register the model with `admin.site.register(Post)`.

OK, time to look at our Post model. Remember to run `python manage.py runserver` in the console to run the web server. Go to the browser and type the address:

http://127.0.0.1:8000/admin/
Copy link
Contributor

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.

http://127.0.0.1:8000/admin/

You will see a login page like this:

Expand Down
6 changes: 3 additions & 3 deletions django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ After adding the line, your html file should now look like this:
</body>
</html>

After saving and refreshing the page `http://127.0.0.1:8000` you will obviously see a familiar `NoReverseMatch` error, right?
After saving and refreshing the page http://127.0.0.1:8000 you will obviously see a familiar `NoReverseMatch` error, right?

## URL

Expand Down Expand Up @@ -198,7 +198,7 @@ Ok, we talked a lot, but we probably want to see what the whole *view* looks lik
form = PostForm()
return render(request, 'blog/post_edit.html', {'form': form})

Let's see if it works. Go to the page `http://127.0.0.1:8000/post/new/`, add a `title` and `text`, save it... and voilà! The new blog post is added and we are redirected to `post_detail` page!
Let's see if it works. Go to the page http://127.0.0.1:8000/post/new/, add a `title` and `text`, save it... and voilà! The new blog post is added and we are redirected to `post_detail` page!

You problably have noticed that we are not setting publish date at all. We will introduce a _publish button_ in __Django Girls Tutorial: Extensions__.

Expand All @@ -214,7 +214,7 @@ Try to save the form without `title` and `text`. Guess, what will happen!

Django is taking care of validating that all the fields in our form are correct. Isn't it awesome?

> As we have recently used the Django admin interface the system currently thinks we are logged in. There are a few situations that could lead to us being logged out (closing the browser, restarting the DB etc.). If you find that you are getting errors creating a post referring to a lack of a logged in user, head to the admin page `http://127.0.0.1:8000/admin` and log in again. This will fix the issue temporarily. There is a permanent fix awaiting you in the __Homework: add security to your website!__ chapter after the main tutorial.
> As we have recently used the Django admin interface the system currently thinks we are logged in. There are a few situations that could lead to us being logged out (closing the browser, restarting the DB etc.). If you find that you are getting errors creating a post referring to a lack of a logged in user, head to the admin page http://127.0.0.1:8000/admin and log in again. This will fix the issue temporarily. There is a permanent fix awaiting you in the __Homework: add security to your website!__ chapter after the main tutorial.

![Logged in error](images/post_create_error.png)

Expand Down
2 changes: 1 addition & 1 deletion django_start_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the first time that 127.0.0.1 is introduced. I think it's good to show that you can also type in an address so I would leave this one as-is.


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).

Expand Down
4 changes: 2 additions & 2 deletions django_urls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Expand All @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Expand Down
6 changes: 3 additions & 3 deletions extend_your_application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Copy link
Contributor

Choose a reason for hiding this comment

The 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:

Expand Down Expand Up @@ -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/
Copy link
Contributor

Choose a reason for hiding this comment

The 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!

Expand Down Expand Up @@ -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/
Copy link
Contributor

Choose a reason for hiding this comment

The 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)

Expand Down