Skip to content

Commit 451f983

Browse files
authored
Merge pull request #1892 from jacebrowning/use-django-5.2
Use Django 5.2 to support both latest Python and PythonAnywhere
2 parents 65ca02a + 5132e10 commit 451f983

10 files changed

Lines changed: 13 additions & 12 deletions

File tree

book.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"gitbook": ">=3.2.0",
33
"variables": {
4-
"py_version": "3.12",
5-
"py_release": "3.12.3",
4+
"py_version": "3.14",
5+
"py_release": "3.14.3",
66
"py_min_version": "3.10",
77
"py_min_release": "3.10.13",
88
"pa_py_version": "3.10",
9-
"django_version": "5.1.2"
9+
"django_version": "5.2.12",
10+
"docs_version": "5.2"
1011
},
1112
"links": {
1213
},

en/deploy/pythonanywhere.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You can also go to the "Files" page and navigate around using PythonAnywhere's b
6868
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. :)
6969

7070

71-
> **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.
71+
> **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/{{ book.docs_version }}/howto/deployment/checklist/) for some tips on securing your site.
7272
7373
## Debugging tips
7474

en/django_admin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ Make sure that at least two or three posts (but not all) have the publish date s
5252

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

55-
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/
55+
If you want to know more about Django admin, you should check Django's documentation: https://docs.djangoproject.com/en/{{ book.docs_version }}/ref/contrib/admin/
5656

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

en/django_forms/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ Feel free to change the title or the text and save the changes!
374374

375375
Congratulations! Your application is getting more and more complete!
376376

377-
If you need more information about Django forms, you should read the documentation: https://docs.djangoproject.com/en/5.1/topics/forms/
377+
If you need more information about Django forms, you should read the documentation: https://docs.djangoproject.com/en/{{ book.docs_version }}/topics/forms/
378378

379379
## Security
380380

en/django_models/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Now we define the properties we were talking about: `title`, `text`, `created_da
164164
- `models.DateTimeField` – this is a date and time.
165165
- `models.ForeignKey` – this is a link to another model.
166166

167-
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).
167+
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/{{ book.docs_version }}/ref/models/fields/#field-types).
168168

169169
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`.
170170

en/django_start_project/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ TIME_ZONE = 'Europe/Berlin'
9595

9696
#### Changing the Language
9797

98-
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).
98+
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/{{ book.docs_version }}/ref/settings/#language-code).
9999

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

en/django_urls/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@ Your console is showing an error, but don't worry – it's actually pretty usefu
112112
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.
113113

114114

115-
> If you want to know more about Django URLconfs, look at the official documentation: https://docs.djangoproject.com/en/5.1/topics/http/urls/
115+
> If you want to know more about Django URLconfs, look at the official documentation: https://docs.djangoproject.com/en/{{ book.docs_version }}/topics/http/urls/

en/django_views/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ Another error! Read what's going on now:
4545

4646
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!
4747

48-
> Learn more about Django views by reading the official documentation: https://docs.djangoproject.com/en/5.1/topics/http/views/
48+
> Learn more about Django views by reading the official documentation: https://docs.djangoproject.com/en/{{ book.docs_version }}/topics/http/views/

en/dynamic_data_in_templates/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ def post_list(request):
7575

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

78-
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/
78+
Want to read a little bit more about QuerySets in Django? You should look here: https://docs.djangoproject.com/en/{{ book.docs_version }}/ref/models/querysets/

en/whats_next/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Yes! There are a _lot_ of resources online for learning all kinds of programming
1414

1515
#### Django
1616
- Our other book, [Django Girls Tutorial: Extensions](https://tutorial-extensions.djangogirls.org/)
17-
- [Django's official tutorial](https://docs.djangoproject.com/en/5.1/intro/tutorial01/)
17+
- [Django's official tutorial](https://docs.djangoproject.com/en/{{ book.docs_version }}/intro/tutorial01/)
1818
- [Getting Started With Django video lessons](https://thekennethlove.com/videos/)
1919
- [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
2020

0 commit comments

Comments
 (0)