Skip to content

Commit

Permalink
Merge pull request #1854 from mcagl/feature/check-tutorial-update-status
Browse files Browse the repository at this point in the history
Update and cleanup of the tutorial after the update to newer python/django versions
  • Loading branch information
amakarudze authored Nov 23, 2024
2 parents fba1420 + 508cef2 commit f72dfe3
Show file tree
Hide file tree
Showing 18 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ This tutorial is maintained by [DjangoGirls](https://djangogirls.org/). If you f

## Would you like to help us translate the tutorial into other languages?

Currently, translations are being kept on crowdin.com platform at:
Currently, translations are being kept on the crowdin.com platform at:

https://crowdin.com/project/django-girls-tutorial

Expand Down
Binary file modified en/chromebook_setup/images/vscode-install-python.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions en/css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Time to write some CSS! Open up the `blog/static/css/blog.css` file in your code
We won't be going too deep into customizing and learning about CSS here. There is a recommendation for a free CSS course at the end of this page if you would like to learn more.

But let's do at least a little. Maybe we could change the color of our headers?
To understand colors, computers use special codes. These codes start with `#` followed by 6 letters (A–F) and numbers (0–9). For example, the code for blue is `#0000FF`. You can find the color codes for many colors here: http://www.colorpicker.com/. You may also use [predefined colors](http://www.w3schools.com/colors/colors_names.asp), such as `red` and `green`.
To understand colors, computers use special codes. These codes start with `#` followed by 6 letters (A–F) and numbers (0–9). For example, the code for blue is `#0000FF`. You can find the color codes for many colors here: https://www.colorpicker.com/. You may also use predefined [named colors](https://developer.mozilla.org/en-US/docs/Web/CSS/named-color), such as `red` and `green`.


In your `blog/static/css/blog.css` file you should add the following code:

Expand All @@ -91,8 +92,7 @@ We also identify elements by the attribute `class` or the attribute `id`. Class
<a href="https://en.wikipedia.org/wiki/Django" class="external_link" id="link_to_wiki_page">
```

You can read more about [CSS Selectors at w3schools](http://www.w3schools.com/cssref/css_selectors.asp).

You can read more about [CSS Selectors at MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors).
We also need to tell our HTML template that we added some CSS. Open the `blog/templates/blog/post_list.html` file in the code editor and add this line at the very beginning of it:

{% filename %}blog/templates/blog/post_list.html{% endfilename %}
Expand Down Expand Up @@ -162,7 +162,7 @@ Maybe we can customize the font in our header? Paste this into your `<head>` in
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext">
```

As before, check the order and place before the link to `blog/static/css/blog.css`. This line will import a font called *Lobster* from Google Fonts (https://www.google.com/fonts).
Again, check the order and place it before the link to `blog/static/css/blog.css`. This line will import a font called *Lobster* from Google Fonts (https://www.google.com/fonts).

Find the `h1 a` declaration block (the code between braces `{` and `}`) in the CSS file `blog/static/css/blog.css`. Now add the line `font-family: 'Lobster';` between the braces, and refresh the page:

Expand Down
Binary file modified en/deploy/images/deployment_cloud.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 modified en/deploy/images/deployment_local.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion en/deploy/pythonanywhere.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ If you see an error while running the `pa_autoconfigure_django.py` script, here

If you see an error when you try to visit your site, the first place to look for some debugging info is in your **error log**. You'll find a link to this on the PythonAnywhere ["Web" page](https://www.pythonanywhere.com/web_app_setup/). See if there are any error messages in there; the most recent ones are at the bottom.

There are also some [general debugging tips on the PythonAnywhere help site](http://help.pythonanywhere.com/pages/DebuggingImportError).
There are also some [general debugging tips on the PythonAnywhere help site](https://help.pythonanywhere.com/pages/DebuggingImportError).

And remember, your coach is here to help!
4 changes: 2 additions & 2 deletions en/django_installation/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ is copyrighted by Markus Zapke-Gründemann et al.

## Virtual environment

Before we install Django we will get you to install an extremely useful tool to help keep your coding environment tidy on your computer. It's possible to skip this step, but it's highly recommended. Starting with the best possible setup will save you a lot of trouble in the future!
Before we install Django we will get you to install an extremely useful tool to help keep your coding environment tidy on your computer. It's possible to skip this step, but it's highly recommended to follow it. Starting with the best possible setup will save you a lot of trouble in the future!

So, let's create a **virtual environment** (also called a *virtualenv*). Virtualenv will isolate your Python/Django setup on a per-project basis. This means that any changes you make to one website won't affect any others you're also developing. Neat, right?

Expand Down Expand Up @@ -125,7 +125,7 @@ C:\Users\Name\djangogirls> myvenv\Scripts\activate
>```
>C:\WINDOWS\system32> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
> Execution Policy Change
> The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at http://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
> The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the about_Execution_Policies help topic at https://go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
>```
<!-- (This comment separates the two blockquote blocks, so that GitBook and Crowdin don't merge them into a single block.) -->
Expand Down
2 changes: 1 addition & 1 deletion en/django_orm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In this chapter you'll learn how Django connects to the database and stores data

A QuerySet is, in essence, a list of objects of a given Model. QuerySets allow you to read the data from the database, filter it and order it.

It's easiest to learn by example. Let's try this, shall we?
It's easier to learn by example. Let's try this, shall we?


## Django shell
Expand Down
6 changes: 3 additions & 3 deletions en/django_start_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ djangogirls
```
> **Note**: in your directory structure, you will also see your `myvenv` directory that we created before.
`manage.py` is a script that helps with management of the site. With it we will be able (amongst other things) to start a web server on our computer without installing anything else.
`manage.py` is a script that helps with management of the site. With it we will be able (among other things) to start a web server on our computer without installing anything else.

The `settings.py` file contains the configuration of your website.

Expand All @@ -77,7 +77,7 @@ Let's ignore the other files for now as we won't change them. The only thing to

Let's make some changes in `mysite/settings.py`. Open the file using the code editor you installed earlier.

**Note**: Keep in mind that `settings.py` is a regular file, like any other. You can open it from inside the code editor, using the "file -> open" menu actions. This should get you the usual window in which you can navigate to your `settings.py` file and select it. Alternatively, you can open the file by navigating to the djangogirls folder on your desktop and right-clicking on it. Then, select your code editor from the list. Selecting the editor is important as you might have other programs installed that can open the file but will not let you edit it.
**Note**: Keep in mind that `settings.py` is a regular file, like any other. You can open it from inside the code editor, using the "File -> Open" menu action. This should get you the usual window in which you can navigate to your `settings.py` file and select it. Alternatively, you can open the file by navigating to the `djangogirls/` folder on your desktop and right-clicking on it. Then, select your code editor from the list. Selecting the editor is important as you might have other programs installed that can open the file but will not let you edit it.

It would be nice to have the correct time on our website. Go to [Wikipedia's list of time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) and copy your relevant time zone (TZ) (e.g. `Europe/Berlin`).

Expand All @@ -102,7 +102,7 @@ We'll also need to add a path for static files. (We'll find out all about static

{% filename %}mysite/settings.py{% endfilename %}
```python
STATIC_URL = '/static/'
STATIC_URL = 'static/'
STATIC_ROOT = BASE_DIR / 'static'
```

Expand Down
Binary file modified en/django_start_project/images/install_worked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion en/extend_your_application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ We will start with adding a link inside `blog/templates/blog/post_list.html` fil

{% raw %}Time to explain the mysterious `{% url 'post_detail' pk=post.pk %}`. As you might suspect, the `{% %}` notation means that we are using Django template tags. This time we will use one that will create a URL for us!{% endraw %}

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

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!

Expand Down
6 changes: 3 additions & 3 deletions en/how_the_internet_works/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

> For readers at home: this chapter is covered in the [How the Internet Works](https://www.youtube.com/watch?v=oM9yAA09wdc) video.
> This chapter is inspired by the talk "How the Internet works" by Jessica McKellar (http://web.mit.edu/jesstess/www/).
> This chapter is inspired by the talk "How the Internet works" by Jessica McKellar (https://web.mit.edu/jesstess/www/).
We bet you use the Internet every day. But do you actually know what happens when you type an address like https://djangogirls.org into your browser and press `enter`?

Expand All @@ -21,7 +21,7 @@ We drew you a picture! It looks like this:

![Figure 1.1](images/internet_1.png)

Looks like a mess, right? In fact it is a network of connected machines (the above-mentioned *servers*). Hundreds of thousands of machines! Many, many kilometers of cables around the world! You can visit a Submarine Cable Map website (http://submarinecablemap.com) to see how complicated the net is. Here is a screenshot from the website:
Looks like a mess, right? In fact it is a network of connected machines (the above-mentioned *servers*). Hundreds of thousands of machines! Many, many kilometers of cables around the world! You can visit a Submarine Cable Map website (https://submarinecablemap.com) to see how complicated the net is. Here is a screenshot from the website:

![Figure 1.2](images/internet_3.png)

Expand All @@ -39,7 +39,7 @@ Your letter goes to the post office closest to you. Then it goes to another that

That's how it works - you send messages and you expect some response. Instead of paper and pen you use bytes of data, but the idea is the same!

Instead of addresses with a street name, city, zip code and country name, we use IP addresses. Your computer first asks the DNS (Domain Name System) to translate djangogirls.org into an IP address. It works a little bit like old-fashioned phonebooks where you can look up the name of the person you want to contact and find their phone number and address.
Instead of addresses with a street name, city, zip code and country name, we use IP addresses. Your computer first asks the DNS (Domain Name System) to translate `djangogirls.org` into an IP address. It works a little bit like old-fashioned phonebooks where you can look up the name of the person you want to contact and find their phone number and address.

When you send a letter, it needs to have certain features to be delivered correctly: an address, a stamp, etc. You also use a language that the receiver understands, right? The same applies to the *data packets* you send to see a website. We use a protocol called HTTP (Hypertext Transfer Protocol).

Expand Down
4 changes: 2 additions & 2 deletions en/html/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Before we upload all the files, let's check what `git` will be uploading (all th
$ git status
```

We're almost there, now it's time to tell it to save this change in its history. We're going to give it a "commit message" where we describe what we've changed. You can type anything you'd like at this stage, but it's helpful to type something descriptive so that you can remember what you've done in the future.
We're almost there, now it's time to tell it to save this change in its history. We're going to give it a "commit message" where we describe what we've changed. You can type anything you'd like at this stage, but it's helpful to type something descriptive so that, in the future, you can remember what you've done.

{% filename %}command-line{% endfilename %}
```
Expand Down Expand Up @@ -218,7 +218,7 @@ $ git pull

You'll need to substitute `<your-pythonanywhere-domain>` with your actual PythonAnywhere subdomain name, without the angle-brackets. Your subdomain name is normally your PythonAnywhere user name, but in some cases it might be a bit different (such as if your user name contains capital letters). So if this command doesn't work, use the `ls` (list files) command to find your actual subdomain/folder name, and then `cd` to there.

Now watch your code get downloaded. If you want to check that it's arrived, you can hop over to the **"Files" page** and view your code on PythonAnywhere (you can reach other PythonAnywhere pages from the menu button on the console page).
Now watch your code getting downloaded. If you want to check that it's arrived, you can hop over to the **"Files" page** and view your code on PythonAnywhere (you can reach other PythonAnywhere pages from the menu button on the console page).


* Finally, hop on over to the ["Web" page](https://www.pythonanywhere.com/web_app_setup/) and hit **Reload** on your web app.
Expand Down
2 changes: 1 addition & 1 deletion en/intro_to_command_line/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ rmdir /S | rm -r | delete a directory | **rm

These are just a very few of the commands you can run in your command line, but you're not going to use anything more than that today.

If you're curious, [ss64.com](http://ss64.com) contains a complete reference of commands for all operating systems.
If you're curious, [ss64.com](https://ss64.com) contains a complete reference of commands for all operating systems.

## Ready?

Expand Down
24 changes: 12 additions & 12 deletions en/intro_to_command_line/open_instructions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<!--sec data-title="Opening: macOS" data-id="macOS_prompt" data-collapse=true ces-->

Go to Launchpad → Other → Terminal.

<!--endsec-->

<!--sec data-title="Opening: Linux" data-id="linux_prompt" data-collapse=true ces-->

It's probably under Applications → Accessories → Terminal, or Applications → System → Terminal, but that may depend on your system. If it's not there, you can try to Google it. :)

<!--endsec-->

<!--sec data-title="Opening: Windows" data-id="windows_prompt" data-collapse=true ces-->

Depending on your version of Windows and your keyboard, one of the following should open a command window (you may have to experiment a bit, but you don't have to try all of these suggestions):
Expand All @@ -13,15 +25,3 @@ Depending on your version of Windows and your keyboard, one of the following sho
Later in this tutorial, you will need to have two command windows open at the same time. However, on some versions of Windows, if you already have one command window open and you try to open a second one using the same method, it will instead point you to the command window you already have open. Try it now on your computer and see what happens! If you only get one command window, try one of the other methods in the list above. At least one of them should result in a new command window being opened.

<!--endsec-->

<!--sec data-title="Opening: macOS" data-id="macOS_prompt" data-collapse=true ces-->

Go to Launchpad → Other → Terminal.

<!--endsec-->

<!--sec data-title="Opening: Linux" data-id="linux_prompt" data-collapse=true ces-->

It's probably under Applications → Accessories → Terminal, or Applications → System → Terminal, but that may depend on your system. If it's not there, you can try to Google it. :)

<!--endsec-->
4 changes: 2 additions & 2 deletions en/python_installation/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ $ python3 --version
Python {{ book.py_release }}
```

If you have a different version of Python installed, at least {{ book.py_min_version }} (e.g. {{ book.py_min_release }}), then you don't have to upgrade. If you don't have Python installed, or if you want a different version, first check what Linux distribution you are using with the following command:
If you have a different version of Python installed, at least {{ book.py_min_version }} (e.g. {{ book.py_min_release }}), then you don't have to upgrade. If you don't have Python installed, or if you want a different version, first check which Linux distribution you are using with the following command:

{% filename %}command-line{% endfilename %}
```
Expand Down Expand Up @@ -108,7 +108,7 @@ Python {{ book.py_release }}
```
The version shown may be different from {{ book.py_release }} -- it should match the version you installed.

**NOTE:** If you're on Windows and you get an error message that `python3` wasn't found, try using `python` (without the `3`) and check if it still might be a version of Python that is {{ book.py_min_version }} or higher. If that doesn't work either, you may open a new command prompt and try again; this happens if you use a command prompt left open from before the Python installation.
**NOTE:** If you're on Windows and you get an error message that `python3` wasn't found, try using `python` (without the `3`) and check if it still might be a version of Python that is {{ book.py_min_version }} or higher. If that doesn't work either, you may open a new command prompt and try again; this happens if you use a command prompt that was opened before the Python installation.

----

Expand Down
2 changes: 1 addition & 1 deletion en/python_introduction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ Which would print:

`range` is a function that creates a list of numbers following one after the other (these numbers are provided by you as parameters).

Note that the second of these two numbers is not included in the list that is output by Python (meaning `range(1, 6)` counts from 1 to 5, but does not include the number 6). That is because "range" is half-open, and by that we mean it includes the first value, but not the last.
Note that the second of these two numbers is not included in the list that is output by Python (meaning `range(1, 6)` counts from 1 to 5, but does not include the number 6). That is because `range` is half-open, and by that we mean it includes the first value, but not the last.

## Summary

Expand Down
Loading

0 comments on commit f72dfe3

Please sign in to comment.