Skip to content

Commit

Permalink
Merge pull request #1820 from dennybiasiolli/updating-tutorial
Browse files Browse the repository at this point in the history
Updating tutorial
  • Loading branch information
fltfx authored Oct 14, 2024
2 parents 00794e2 + cfaabfa commit 3886adb
Show file tree
Hide file tree
Showing 44 changed files with 55 additions and 55 deletions.
6 changes: 3 additions & 3 deletions book.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"variables": {
"py_version": "3.12",
"py_release": "3.12.3",
"py_min_version": "3.9",
"py_min_release": "3.9.19",
"py_min_version": "3.10",
"py_min_release": "3.10.13",
"pa_py_version": "3.10",
"django_version": "4.2.11"
"django_version": "5.1.2"
},
"links": {
},
Expand Down
4 changes: 2 additions & 2 deletions de/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Um eine Web App auf PythonAnywhere publizieren zu können, muss dein Code von Gi

{% filename %}PythonAnywhere command-line{% endfilename %}

$ pip3.8 install --user pythonanywhere
$ pip install --user pythonanywhere


Nach diesem Befehl solltest du in etwa Folgendes sehen: `Collecting pythonanywhere`, und irgendwann den Schluss `Successfully installed (...) pythonanywhere- (...)`.
Expand All @@ -180,7 +180,7 @@ Nun können wir mit dem Hilfstool unsere App von GitHub automatisch konfiguriere

{% filename %}PythonAnywhere command-line{% endfilename %}

$ pa_autoconfigure_django.py --python=3.8 https://github.com/<your-github-username>/my-first-blog.git
$ pa_autoconfigure_django.py --python=3.10 https://github.com/<your-github-username>/my-first-blog.git


Während du die Ausführung verfolgst, wirst du sehen, was passiert:
Expand Down
2 changes: 1 addition & 1 deletion de/django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Es ist an der Zeit, `blog/templates/blog/base.html` im Code-Editor zu öffnen. J

Beachte, dass wir unsere neue View `post_new` nennen wollen. Das [SVG-Icon](https://icons.getbootstrap.com/icons/file-earmark-plus/) wird von [Bootstrap Icons](https://icons.getbootstrap.com/) zur Verfügung gestellt und zeigt ein Seitensymbol mit Pluszeichen an. Wir verwenden eine Django-Template-Direktive namens `include`. Dadurch wird der Inhalt der Datei in das Django-Template eingefügt. Der Web-Browser weiß, wie man diese Art von Inhalt ohne weitere Verarbeitung handhabt.

> Alle Bootstrap-Icons kannst du [hier herunterladen](https://github.com/twbs/icons/releases/download/v1.1.0/bootstrap-icons-1.1.0.zip). Entpacke die Datei und kopiere alle SVG-Bilddateien in einen neuen Ordner namens `icons` innerhalb von `blog/templates/blog/`. So kannst du auf ein Symbol wie `pencil-fill.svg` mit dem Dateipfad `blog/templates/blog/icons/pencil-fill.svg` zugreifen
> Alle Bootstrap-Icons kannst du [hier herunterladen](https://github.com/twbs/icons/releases/download/v1.11.3/bootstrap-icons-1.11.3.zip). Entpacke die Datei und kopiere alle SVG-Bilddateien in einen neuen Ordner namens `icons` innerhalb von `blog/templates/blog/`. So kannst du auf ein Symbol wie `pencil-fill.svg` mit dem Dateipfad `blog/templates/blog/icons/pencil-fill.svg` zugreifen
Nach dem Bearbeiten der Zeile sieht deine HTML-Datei so aus:

Expand Down
4 changes: 2 additions & 2 deletions en/css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ To install Bootstrap, open up your `.html` file in the code editor and add this

{% filename %}blog/templates/blog/post_list.html{% endfilename %}
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
```

This doesn't add any files to your project. It just points to files that exist on the Internet. So go ahead, open your website and refresh the page. Here it is!
Expand Down Expand Up @@ -119,7 +119,7 @@ Your file should now look like this:
<html>
<head>
<title>Django Girls blog</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
</head>
<body>
Expand Down
Binary file modified en/deploy/images/new_github_repo.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 @@ -68,7 +68,7 @@ You can also go to the "Files" page and navigate around using PythonAnywhere's b
Your site should now be live on the public Internet! Click through to the PythonAnywhere "Web" page to get a link to it. You can share this with anyone you want. :)


> **Note** This is a beginners' tutorial, and in deploying this site we've taken a few shortcuts which aren't ideal from a security point of view. If and when you decide to build on this project, or start a new project, you should review the [Django deployment checklist](https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/) for some tips on securing your site.
> **Note** This is a beginners' tutorial, and in deploying this site we've taken a few shortcuts which aren't ideal from a security point of view. If and when you decide to build on this project, or start a new project, you should review the [Django deployment checklist](https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/) for some tips on securing your site.
## Debugging tips

Expand Down
2 changes: 1 addition & 1 deletion en/django_admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ Make sure that at least two or three posts (but not all) have the publish date s

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

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

This is probably a good moment to grab a coffee (or tea) or something to eat to re-energize yourself. You created your first Django model – you deserve a little break!
6 changes: 3 additions & 3 deletions en/django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ It's time to open `blog/templates/blog/base.html` in the code editor. Now we can

Note that we want to call our new view `post_new`. The [SVG icon](https://icons.getbootstrap.com/icons/file-earmark-plus/) is provided by the [Bootstrap Icons](https://icons.getbootstrap.com/) and it will display a page icon with plus sign. We use a Django template directive called `include`. This will inject the file's content into the Django template. The web browser knows how to handle this type of content without any further processing.

> You can download all the Bootstrap icons [here](https://github.com/twbs/icons/releases/download/v1.1.0/bootstrap-icons-1.1.0.zip). Unzip the file and copy all the SVG image files into a new folder inside `blog/templates/blog/` called `icons`. That way you can access an icon like `pencil-fill.svg` using the file path `blog/templates/blog/icons/pencil-fill.svg`
> You can download all the Bootstrap icons [here](https://github.com/twbs/icons/releases/download/v1.11.3/bootstrap-icons-1.11.3.zip). Unzip the file and copy all the SVG image files into a new folder inside `blog/templates/blog/` called `icons`. That way you can access an icon like `pencil-fill.svg` using the file path `blog/templates/blog/icons/pencil-fill.svg`
After editing the line, your HTML file should now look like this:

Expand All @@ -70,7 +70,7 @@ After editing the line, your HTML file should now look like this:
<html>
<head>
<title>Django Girls blog</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext">
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
</head>
Expand Down Expand Up @@ -374,7 +374,7 @@ Feel free to change the title or the text and save the changes!

Congratulations! Your application is getting more and more complete!

If you need more information about Django forms, you should read the documentation: https://docs.djangoproject.com/en/4.2/topics/forms/
If you need more information about Django forms, you should read the documentation: https://docs.djangoproject.com/en/5.1/topics/forms/

## Security

Expand Down
2 changes: 1 addition & 1 deletion en/django_models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Now we define the properties we were talking about: `title`, `text`, `created_da
- `models.DateTimeField` – this is a date and time.
- `models.ForeignKey` – this is a link to another model.

We will not explain every bit of code here since it would take too much time. You should take a look at Django's documentation if you want to know more about Model fields and how to define things other than those described above (https://docs.djangoproject.com/en/3.2/ref/models/fields/#field-types).
We will not explain every bit of code here since it would take too much time. You should take a look at Django's documentation if you want to know more about Model fields and how to define things other than those described above (https://docs.djangoproject.com/en/5.1/ref/models/fields/#field-types).

What about `def publish(self):`? This is exactly the `publish` method we were talking about before. `def` means that this is a function/method and `publish` is the name of the method. You can change the name of the method if you want. The naming rule is that we use lowercase and underscores instead of spaces. For example, a method that calculates average price could be called `calculate_average_price`.

Expand Down
2 changes: 1 addition & 1 deletion en/django_start_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ In `settings.py`, find the line that contains `TIME_ZONE` and modify it to choos
TIME_ZONE = 'Europe/Berlin'
```

A language code consist of the language, e.g. `en` for English or `de` for German, and the country code, e.g. `de` for Germany or `ch` for Switzerland. If English is not your native language, you can add this to change the default buttons and notifications from Django to be in your language. So you would have "Cancel" button translated into the language you defined here. [Django comes with a lot of prepared translations](https://docs.djangoproject.com/en/4.2/ref/settings/#language-code).
A language code consist of the language, e.g. `en` for English or `de` for German, and the country code, e.g. `de` for Germany or `ch` for Switzerland. If English is not your native language, you can add this to change the default buttons and notifications from Django to be in your language. So you would have "Cancel" button translated into the language you defined here. [Django comes with a lot of prepared translations](https://docs.djangoproject.com/en/5.1/ref/settings/#language-code).

If you want a different language, change the language code by changing the following line:

Expand Down
2 changes: 1 addition & 1 deletion en/django_urls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,4 @@ Your console is showing an error, but don't worry – it's actually pretty usefu
If you see a different error message, try restarting your web server. To do that, in the console window that is running the web server, stop it by pressing Ctrl+C (the Control and C keys together). On Windows, you might have to press Ctrl+Break. Then you need to restart the web server by running a `python manage.py runserver` command.


> If you want to know more about Django URLconfs, look at the official documentation: https://docs.djangoproject.com/en/4.2/topics/http/urls/
> If you want to know more about Django URLconfs, look at the official documentation: https://docs.djangoproject.com/en/5.1/topics/http/urls/
2 changes: 1 addition & 1 deletion en/django_views/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ Another error! Read what's going on now:

This shows that the server is running again, at least, but it still doesn't look right, does it? Don't worry, it's just an error page, nothing to be scared of! Just like the error messages in the console, these are actually pretty useful. You can read that the *TemplateDoesNotExist*. Let's fix this bug and create a template in the next chapter!

> Learn more about Django views by reading the official documentation: https://docs.djangoproject.com/en/4.2/topics/http/views/
> Learn more about Django views by reading the official documentation: https://docs.djangoproject.com/en/5.1/topics/http/views/
2 changes: 1 addition & 1 deletion en/dynamic_data_in_templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ def post_list(request):

That's it! Time to go back to our template and display this QuerySet!

Want to read a little bit more about QuerySets in Django? You should look here: https://docs.djangoproject.com/en/3.2/ref/models/querysets/
Want to read a little bit more about QuerySets in Django? You should look here: https://docs.djangoproject.com/en/5.1/ref/models/querysets/
Binary file modified en/python_installation/images/python-installation-options.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/template_extending/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Then open it up in the code editor and copy everything from `post_list.html` to
<html>
<head>
<title>Django Girls blog</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext">
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
</head>
Expand Down
2 changes: 1 addition & 1 deletion en/whats_next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Yes! There are a _lot_ of resources online for learning all kinds of programming

#### Django
- Our other book, [Django Girls Tutorial: Extensions](https://tutorial-extensions.djangogirls.org/)
- [Django's official tutorial](https://docs.djangoproject.com/en/4.2/intro/tutorial01/)
- [Django's official tutorial](https://docs.djangoproject.com/en/5.1/intro/tutorial01/)
- [Getting Started With Django video lessons](http://www.gettingstartedwithdjango.com/)
- [Django for Everybody Specialization](https://www.coursera.org/specializations/django) – some video lectures can be audited for free and you can earn a Coursera Certificate by taking these courses

Expand Down
4 changes: 2 additions & 2 deletions fa/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@

{% filename %}خط فرمان PythonAnywhere {% endfilename %}

$ pip3.8 install --user pythonanywhere
$ pip install --user pythonanywhere


این دستور باید چیزهایی شبیه به `Collecting pythonanywhere` بر روی صفحه نشان دهد و در انتها نیز این پیغام `Successfully installed (...) pythonanywhere- (...)` نمایش داده خواهد شد.
Expand All @@ -180,7 +180,7 @@

{% filename %}خط فرمان PythonAnywhere {% endfilename %}

$ pa_autoconfigure_django.py --python=3.8 https://github.com/<your-github-username>/my-first-blog.git
$ pa_autoconfigure_django.py --python=3.10 https://github.com/<your-github-username>/my-first-blog.git


همینطور که به اجراشدن آن نگاه می‌کنید می‌توانید بفهمید که چه کاری انجام می‌دهد:
Expand Down
2 changes: 1 addition & 1 deletion fa/django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class PostForm(forms.ModelForm):

توجه داشته باشید که ما می‌خواهیم نام ویو جدید را `post_new` بگذاریم. آیتم [SVG icon](https://icons.getbootstrap.com/icons/file-earmark-plus/) توسط [Bootstrap Icons](https://icons.getbootstrap.com/) ارائه می‌شود و علامتی مانند یک صفحه به همراه یک علامت به اضافه، نشان خواهد داد. ما از یک هدایت‌کننده جنگو یا Django template directive، به اسم `include` استفاده می‌کنیم. این هدایت‌کننده محتوای یک فایل را به تمپلیت جنگو تزریق می‌کند. مرورگر وب به خوبی می‌تواند این نوع از محتوا را بدون پردازش‌های اضافه، مدیریت کند.

> شما می‌توانید تمام آیکون‌های بوتسترپ را از [اینجا](https://github.com/twbs/icons/releases/download/v1.1.0/bootstrap-icons-1.1.0.zip) دانلود کنید. فایل را از حالت زیپ خارج کنید و همه تصاویر را در پوشه‌ای به نام `icons` در داخل پوشه `blog/templates/blog/` قرار دهید. به این روش شما می‌توانید به آیکونی مانند `pencil-fill.svg` از طریق آدرس `blog/templates/blog/icons/pencil-fill.svg`، دسترسی داشته باشید
> شما می‌توانید تمام آیکون‌های بوتسترپ را از [اینجا](https://github.com/twbs/icons/releases/download/v1.11.3/bootstrap-icons-1.11.3.zip) دانلود کنید. فایل را از حالت زیپ خارج کنید و همه تصاویر را در پوشه‌ای به نام `icons` در داخل پوشه `blog/templates/blog/` قرار دهید. به این روش شما می‌توانید به آیکونی مانند `pencil-fill.svg` از طریق آدرس `blog/templates/blog/icons/pencil-fill.svg`، دسترسی داشته باشید
بعد از اصلاح این خط، فایل شما باید به این شکل باشد:

Expand Down
4 changes: 2 additions & 2 deletions fr/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Pour déployer une application sur PythonAnywhere, vous devez y télécharger vo

{% filename %}PythonAnywhere command-line{% endfilename %}

$ pip3.8 install --user pythonanywhere
$ pip install --user pythonanywhere


Vous devriez voir quelque chose comme `Collecting pythonanywhere`, et au bout d'un moment une dernière ligne disant `Successfully installed (...) pythonanywhere-(...)`.
Expand All @@ -184,7 +184,7 @@ Maintenant, nous exécutez l'assistant pour configurer automatiquement votre app

{% filename %}PythonAnywhere command-line{% endfilename %}

$ pa_autoconfigure_django.py --python=3.8 https://github.com/<your-github-username>/my-first-blog.git
$ pa_autoconfigure_django.py --python=3.10 https://github.com/<your-github-username>/my-first-blog.git


En regardant la commande s'exécuter, vous devriez voir ce qui ce passe:
Expand Down
2 changes: 1 addition & 1 deletion fr/django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Il est temps d'ouvrir `blog/templates/blog/base.html` dans l'éditeur de code. M

Remarquez que notre nouvelle vue s'appelle `post_new`. L'icône [SVG](https://icons.getbootstrap.com/icons/file-earmark-plus/) est fournie par les [icônes Bootstrap](https://icons.getbootstrap.com/) et elle affichera une icône de page avec le signe plus. Nous utilisons une directive de modèle Django appelée `include`. Cela injectera le contenu du fichier dans le template Django. Le navigateur web sait comment gérer ce type de contenu sans aucun traitement supplémentaire.

> Vous pouvez télécharger toutes les icônes Bootstrap [ici](https://github.com/twbs/icons/releases/download/v1.1.0/bootstrap-icons-1.1.0.zip). Décompressez le fichier et copiez tous les fichiers image SVG vers un nouveau dossier dans `blog/templates/blog/` intitulé `icons`. De cette façon, vous pouvez accéder à une icône comme `pencil-fill.svg` en référençant le chemin du fichier `blog/templates/blog/icons/pencil-fill.svg`
> Vous pouvez télécharger toutes les icônes Bootstrap [ici](https://github.com/twbs/icons/releases/download/v1.11.3/bootstrap-icons-1.11.3.zip). Décompressez le fichier et copiez tous les fichiers image SVG vers un nouveau dossier dans `blog/templates/blog/` intitulé `icons`. De cette façon, vous pouvez accéder à une icône comme `pencil-fill.svg` en référençant le chemin du fichier `blog/templates/blog/icons/pencil-fill.svg`
Après avoir ajouté cette ligne, votre fichier HTML devrait maintenant ressembler à ceci :

Expand Down
Loading

0 comments on commit 3886adb

Please sign in to comment.