Skip to content

Commit 32879cd

Browse files
committed
Update links and references for new datasets.
1 parent f19edd9 commit 32879cd

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ please scroll down to [Windows non-WSL Setup](#windows-non-wsl-setup).
127127
1. Verify the following pages load:
128128
* http://127.0.0.1:8000/
129129
* http://127.0.0.1:8000/p/
130-
* http://127.0.0.1:8000/p/author-up-language-push-162/
130+
* http://127.0.0.1:8000/p/term-writer-recognize-race-available-5291/
131131
1. Log into the admin ([link](http://127.0.0.1:8000/admin/)) with your super user.
132132
1. Verify the following pages load:
133133
* http://127.0.0.1:8000/post/create/
@@ -183,7 +183,7 @@ Proceed to [Lab 1](docs/lab1.md).
183183
1. Verify the following pages load:
184184
* http://127.0.0.1:8000/
185185
* http://127.0.0.1:8000/p/
186-
* http://127.0.0.1:8000/p/author-up-language-push-162/
186+
* http://127.0.0.1:8000/p/term-writer-recognize-race-available-5291/
187187
1. Log into the admin ([link](http://127.0.0.1:8000/admin/)) with your super user.
188188
1. Verify the following pages load:
189189
* http://127.0.0.1:8000/post/create/

docs/lab1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Let's consider what we know:
118118

119119
- Does the file show up on the server side?
120120
- Using the IDE's debugger, a ``breakpoint()`` line or a print statement, inspect
121-
[``request.FILES``](https://docs.djangoproject.com/en/4.1/ref/request-response/#django.http.HttpRequest.FILES).
121+
[``request.FILES``](https://docs.djangoproject.com/en/stable/ref/request-response/#django.http.HttpRequest.FILES).
122122
- Are there any files included? Is ``"open_graph_image"`` a key?
123123
- Is the file being sent from the browser to the server?
124124
- We can use the browser's Developer Tool's Network panel to inspect the request.
@@ -208,8 +208,8 @@ Let's consider what we know:
208208
The posts are being ordered correctly, ``publish_at`` first, falling back to
209209
``created`` when unset. Therefore the template must be rendering incorrectly.
210210
This can be confirmed by comparing the fields of the posts that render
211-
[correctly](http://127.0.0.1:8000/admin/newsletter/post/?slug=skill-fight-girl-north-production-thus-a-58113)
212-
and [incorrectly](http://127.0.0.1:8000/admin/newsletter/post/?slug=campaign-expect-page-information-wrong-more-8656).
211+
[correctly](http://127.0.0.1:8000/admin/newsletter/post/?slug=hear-after-debate-thousand-medical-give-85694)
212+
and [incorrectly](http://127.0.0.1:8000/admin/newsletter/post/?slug=add-they-debate-guess-leg-21809).
213213
From the admin, we can see the correctly rendering Post does not have a value
214214
for ``publish_at``, while the incorrectly rendering Post does have a value
215215
for ``publish_at``. We can see that the ``publish_at`` value is significantly

docs/lab2.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Lab 2
33

4-
Let's kick it up a notch with some [Django Debug Toolbar](https://github.com/jazzband/django-debug-toolbar/)!
4+
Let's kick it up a notch with some [Django Debug Toolbar](https://github.com/django-commons/django-debug-toolbar/)!
55

66
## Lab 2.1
77

@@ -17,7 +17,7 @@ The site seems to be running slower lately. Please make the site fast again!
1717

1818
To reproduce:
1919
1. Browse to the [posts page](http://127.0.0.1:8000/p/).
20-
1. Browse to a [post's page](http://127.0.0.1:8000/p/author-up-language-push-162/).
20+
1. Browse to a [post's page](http://127.0.0.1:8000/p/term-writer-recognize-race-available-5291/).
2121
1. Browse to the [posts admin page](http://127.0.0.1:8000/admin/newsletter/post/).
2222
1. Why are these slow?
2323

@@ -62,14 +62,14 @@ is a never ending, relentless battle.
6262

6363
#### Post listing admin
6464
The admin page suffers from a [N+1 problem](https://ddg.gg?q=N%2B1+django) and
65-
needs to make use of [``prefetch_related``](https://docs.djangoproject.com/en/4.1/ref/models/querysets/#django.db.models.query.QuerySet.prefetch_related)
65+
needs to make use of [``prefetch_related``](https://docs.djangoproject.com/en/stable/ref/models/querysets/#django.db.models.query.QuerySet.prefetch_related)
6666
since it renders each category of the post on the page. This can be chained on
6767
the QuerySet by overriding ``ModelAdmin.get_queryset``. The need for
6868
``prefetch_related`` is evident from the 100 duplicated queries that are fetching data from the table
6969
``newsletter_post_categories``. That table is the intermediate table used with
7070
a ``models.ManyToManyField``. There is a slight wrinkle in that the categories
7171
are being rendered in order of the categories' titles. In order to push that
72-
to the database, you must use a [``Prefetch``](https://docs.djangoproject.com/en/4.1/ref/models/querysets/#django.db.models.Prefetch)
72+
to the database, you must use a [``Prefetch``](https://docs.djangoproject.com/en/stable/ref/models/querysets/#django.db.models.Prefetch)
7373
object that specifies:
7474

7575
```python
@@ -164,7 +164,7 @@ squeeze all the speedy goodness out of the application.
164164

165165
That said, consider the application(s) you work on. What are the most
166166
frequently used parts? What do you have in place to catch slowness?
167-
Could you benefit from using [``assertNumQueries(...)``](https://docs.djangoproject.com/en/4.1/topics/testing/tools/#django.test.TransactionTestCase.assertNumQueries)?
167+
Could you benefit from using [``assertNumQueries(...)``](https://docs.djangoproject.com/en/stable/topics/testing/tools/#django.test.TransactionTestCase.assertNumQueries)?
168168

169169

170170
## Lab 2.2
@@ -302,7 +302,7 @@ Let's consider what we know:
302302
count.
303303
- This can be fixed by using an appropriate ``GROUP BY`` clause in the SQL.
304304
- What does the Django ORM's ``Count`` expression offer in terms of parameters?
305-
- You can use the [docs](https://docs.djangoproject.com/en/4.1/ref/models/querysets/#id9)
305+
- You can use the [docs](https://docs.djangoproject.com/en/stable/ref/models/querysets/#id9)
306306
or inspect [the code](https://github.com/django/django/blob/stable/4.1.x/django/db/models/aggregates.py#L145-L149)
307307
(right click on ``Count`` and choose "Go To Definition") in
308308
your IDE if you're using PyCharm or VSCode.

0 commit comments

Comments
 (0)