Skip to content

Commit

Permalink
Fixed #5
Browse files Browse the repository at this point in the history
  • Loading branch information
olasitarska committed Jul 7, 2014
1 parent a64bd96 commit e40d778
Show file tree
Hide file tree
Showing 41 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions django_admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ Ok, time to look at our Post model. Go to the browser and type an address:

You will see a login page like this:

![Login page](images/login_page.png)
![Login page](images/login_page2.png)

You should use the username and password you chose when you were creating a database (in "Starting Django project" chapter). After login in, you should see the Django admin dashboard.

![Django admin](images/django_admin.png)
![Django admin](images/django_admin3.png)

Go to Post and experiment a little bit with it. Add five or six blog posts. Don't worry about the content - you can simple copy-paste some text from this tutorial as your posts content to save time :).

Make sure that at least two or three (but not all) have publish date set. It will be helpful later.

![Django admin](images/edit_post.png)
![Django admin](images/edit_post3.png)

If you want to know more about the Django admin, you should check Django's documentation: https://docs.djangoproject.com/en/1.6/ref/contrib/admin/

Expand Down
Binary file removed django_admin/images/django_admin.png
Binary file not shown.
Binary file added django_admin/images/django_admin3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed django_admin/images/edit_post.png
Binary file not shown.
Binary file added django_admin/images/edit_post3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed django_admin/images/login_page.png
Binary file not shown.
Binary file added django_admin/images/login_page2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ We need to create a file `post_edit.html` in the `mysite/blog/template/blog` dir
- we need a `Save` button. We do that with HTML: `<button type="submit">Save</button>`
- and finally just after the `<form ...>` tag we need to add `{% csfr_token %}`. This is very important, since it makes your forms secure! Django will complain if you forget about this bit if you try to save the form:

![CSFR Forbidden page](images/csrf.png)
![CSFR Forbidden page](images/csrf2.png)

Ok, so let's see how the HTML should look like:

Expand All @@ -139,7 +139,7 @@ Ok, so let's see how the HTML should look like:

Time to refresh! Yay! Your form is displayed!

![New form](images/new_form.png)
![New form](images/new_form2.png)

But, wait a minute! When you type something in `title` and `text` fields and try to save it - what will happen?

Expand Down Expand Up @@ -213,7 +213,7 @@ Now, we will show you how cool Django forms are. Blog post needs to have `title`

Try to save the form without `title` and `text`. Guess, what will happen!

![Form validation](images/form_validation.png)
![Form validation](images/form_validation2.png)

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

Expand Down Expand Up @@ -271,11 +271,11 @@ or we just opened a form with this post without saving anything yet:

Ok, let's test if it works! Let's go to `post_detail` page. There should be an edit button in top right corner:

![Edit button](images/edit_button.png)
![Edit button](images/edit_button2.png)

When you click it you will see the form with our blog post:

![Edit form](images/edit_form.png)
![Edit form](images/edit_form2.png)

Feel free to change the title or the text and save changes!

Expand Down
Binary file removed django_forms/images/csrf.png
Binary file not shown.
Binary file added django_forms/images/csrf2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed django_forms/images/edit_button.png
Binary file not shown.
Binary file added django_forms/images/edit_button2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed django_forms/images/edit_form.png
Binary file not shown.
Binary file added django_forms/images/edit_form2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed django_forms/images/form_validation.png
Binary file not shown.
Binary file added django_forms/images/form_validation2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed django_forms/images/new_form.png
Binary file not shown.
Binary file added django_forms/images/new_form2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions extend_your_application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Now when we go to:

we will have an error (as suspected, since we don't have a url or a view for `post_detail`). It will look like this:

![NoReverseMatch error](images/no_reverse_match.png)
![NoReverseMatch error](images/no_reverse_match2.png)

Let's create a url in `urls.py` for our `post_detail` view!

Expand Down Expand Up @@ -73,7 +73,7 @@ Ok! Let's refresh the page:

Boom! Yet another error! As expected!

![AttributeError](images/attribute_error.png)
![AttributeError](images/attribute_error2.png)

Do you remember what the next step is? Of course: adding a view!

Expand All @@ -87,11 +87,11 @@ Now, we want to get one and only one blog post. To do this we can use querysets

But this code has a problem. If there is no `Post` with given `primary key` we will have super ugly error!

![DoesNotExist error](images/does_not_exist.png)
![DoesNotExist error](images/does_not_exist2.png)

We don't want it! But, of course, Django comes with something that will handle that for us: `get_object_or_404`. In case there is no `Post` with given `pk` it will display much nicer page (called `Page Not Found 404` page).

![Page not found](images/404.png)
![Page not found](images/404_2.png)

The good news is that you actually can create your own `Page not found` page and make it as pretty as you want. But it's not super important right now, so we will skip it.

Expand All @@ -111,11 +111,11 @@ Yes. It is time to refresh the page:

http://127.0.0.1:8000/

![Post list view](images/post_list.png)
![Post list view](images/post_list2.png)

It worked! But what happens when you click a link in blog post title?

![TemplateDoesNotExist error](images/template_does_not_exist.png)
![TemplateDoesNotExist error](images/template_does_not_exist2.png)

Oh no! Error once again. But we already know how to deal with it, right? We need to add a template!

Expand All @@ -141,7 +141,7 @@ Once again we are extending `base.html`. In `content` block we want to display a

Ok we can refresh our page and see if `Page not found` is gone now.

![Post detail page](images/post_detail.png)
![Post detail page](images/post_detail2.png)

Yay! It works!

Expand Down
Binary file removed extend_your_application/images/404.png
Binary file not shown.
Binary file added extend_your_application/images/404_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed extend_your_application/images/attribute_error.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed extend_your_application/images/does_not_exist.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed extend_your_application/images/no_reverse_match.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed extend_your_application/images/post_detail.png
Binary file not shown.
Binary file added extend_your_application/images/post_detail2.png
Binary file removed extend_your_application/images/post_list.png
Diff not rendered.
Binary file added extend_your_application/images/post_list2.png
Diff not rendered.
4 changes: 2 additions & 2 deletions homework_add_more_to_your_website/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Now we can finally use this!

And once again after publishing the post we are immediately redirected to the `post_detail` page!

![Publish button](images/publish.png)
![Publish button](images/publish2.png)

Congratulations! You are almost there. The last step is adding a delete button!

Expand Down Expand Up @@ -114,7 +114,7 @@ And this time, after deleting a post we want to go to the webpage with a list of

Let's test it! Go to the page with a post and try to delete it!

![Delete button](images/delete.png)
![Delete button](images/delete3.png)

Yes, it is the last thing! You completed this tutorial! You are awesome!

Expand Down
Binary file removed homework_add_more_to_your_website/images/delete.png
Diff not rendered.
Diff not rendered.
2 changes: 1 addition & 1 deletion starting_django_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Now all you need to do is to check if your website is running :). Open your brow

Congratulations! You've just created your first website and run it using a web server! Isn't it awesome?

![It worked!](images/it_worked.png)
![It worked!](images/it_worked2.png)

Ready for the next steps? It's time to create some content!

Expand Down
Binary file removed starting_django_project/images/it_worked.png
Diff not rendered.
Binary file added starting_django_project/images/it_worked2.png

0 comments on commit e40d778

Please sign in to comment.