Skip to content

Commit 24fd58c

Browse files
committed
revert django docs link change
1 parent 75346de commit 24fd58c

File tree

10 files changed

+31
-31
lines changed

10 files changed

+31
-31
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ Using the following categories, list your changes in this order:
8080
- New Django `User` related features!
8181
- `reactpy_django.hooks.use_user` can be used to access the current user.
8282
- `reactpy_django.hooks.use_user_data` provides a simplified interface for storing user key-value data.
83-
- `reactpy_django.decorators.user_passes_test` is inspired by the [equivalent Django decorator](http://docs.djangoproject.com/en/stable/topics/auth/default/#django.contrib.auth.decorators.user_passes_test), but ours works with ReactPy components.
84-
- `settings.py:REACTPY_AUTO_RELOGIN` will cause component WebSocket connections to automatically [re-login](https://channels.readthedocs.io/en/latest/topics/authentication.html#how-to-log-a-user-in-out) users that are already authenticated. This is useful to continuously update `last_login` timestamps and refresh the [Django login session](https://docs.djangoproject.com/en/stable/topics/http/sessions/).
83+
- `reactpy_django.decorators.user_passes_test` is inspired by the [equivalent Django decorator](http://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.decorators.user_passes_test), but ours works with ReactPy components.
84+
- `settings.py:REACTPY_AUTO_RELOGIN` will cause component WebSocket connections to automatically [re-login](https://channels.readthedocs.io/en/latest/topics/authentication.html#how-to-log-a-user-in-out) users that are already authenticated. This is useful to continuously update `last_login` timestamps and refresh the [Django login session](https://docs.djangoproject.com/en/dev/topics/http/sessions/).
8585

8686
### Changed
8787

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def hello_world(recipient: str):
8282

8383
<!--py-code-end-->
8484

85-
## [`my_app/templates/my-template.html`](https://docs.djangoproject.com/en/stable/topics/templates/)
85+
## [`my_app/templates/my-template.html`](https://docs.djangoproject.com/en/dev/topics/templates/)
8686

8787
<!--html-header-start-->
8888

docs/src/learn/add-reactpy-to-a-django-project.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you want to add some interactivity to your existing **Django project**, you d
88

99
!!! abstract "Note"
1010

11-
These docs assumes you have already created [a **Django project**](https://docs.djangoproject.com/en/stable/intro/tutorial01/), which involves creating and installing at least one **Django app**.
11+
These docs assumes you have already created [a **Django project**](https://docs.djangoproject.com/en/dev/intro/tutorial01/), which involves creating and installing at least one **Django app**.
1212

1313
If do not have a **Django project**, check out this [9 minute YouTube tutorial](https://www.youtube.com/watch?v=ZsJRXS_vrw0) created by _IDG TECHtalk_.
1414

@@ -24,7 +24,7 @@ pip install reactpy-django
2424

2525
## Step 2: Configure `settings.py`
2626

27-
Add `#!python "reactpy_django"` to [`INSTALLED_APPS`](https://docs.djangoproject.com/en/stable/ref/settings/#std:setting-INSTALLED_APPS) in your [`settings.py`](https://docs.djangoproject.com/en/stable/topics/settings/) file.
27+
Add `#!python "reactpy_django"` to [`INSTALLED_APPS`](https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-INSTALLED_APPS) in your [`settings.py`](https://docs.djangoproject.com/en/dev/topics/settings/) file.
2828

2929
=== "settings.py"
3030

@@ -36,7 +36,7 @@ Add `#!python "reactpy_django"` to [`INSTALLED_APPS`](https://docs.djangoproject
3636

3737
ReactPy-Django requires Django ASGI and [Django Channels](https://github.com/django/channels) WebSockets.
3838

39-
If you have not enabled ASGI on your **Django project** yet, here is a summary of the [`django`](https://docs.djangoproject.com/en/stable/howto/deployment/asgi/) and [`channels`](https://channels.readthedocs.io/en/stable/installation.html) installation docs:
39+
If you have not enabled ASGI on your **Django project** yet, here is a summary of the [`django`](https://docs.djangoproject.com/en/dev/howto/deployment/asgi/) and [`channels`](https://channels.readthedocs.io/en/stable/installation.html) installation docs:
4040

4141
1. Install `channels[daphne]`
4242
2. Add `#!python "daphne"` to `#!python INSTALLED_APPS`.
@@ -59,7 +59,7 @@ Add `#!python "reactpy_django"` to [`INSTALLED_APPS`](https://docs.djangoproject
5959

6060
## Step 3: Configure `urls.py`
6161

62-
Add ReactPy HTTP paths to your `#!python urlpatterns` in your [`urls.py`](https://docs.djangoproject.com/en/stable/topics/http/urls/) file.
62+
Add ReactPy HTTP paths to your `#!python urlpatterns` in your [`urls.py`](https://docs.djangoproject.com/en/dev/topics/http/urls/) file.
6363

6464
=== "urls.py"
6565

@@ -69,7 +69,7 @@ Add ReactPy HTTP paths to your `#!python urlpatterns` in your [`urls.py`](https:
6969

7070
## Step 4: Configure `asgi.py`
7171

72-
Register ReactPy's WebSocket using `#!python REACTPY_WEBSOCKET_ROUTE` in your [`asgi.py`](https://docs.djangoproject.com/en/stable/howto/deployment/asgi/) file.
72+
Register ReactPy's WebSocket using `#!python REACTPY_WEBSOCKET_ROUTE` in your [`asgi.py`](https://docs.djangoproject.com/en/dev/howto/deployment/asgi/) file.
7373

7474
=== "asgi.py"
7575

@@ -97,15 +97,15 @@ Register ReactPy's WebSocket using `#!python REACTPY_WEBSOCKET_ROUTE` in your [`
9797

9898
## Step 5: Run database migrations
9999

100-
Run Django's [`migrate` command](https://docs.djangoproject.com/en/stable/topics/migrations/) to initialize ReactPy-Django's database table.
100+
Run Django's [`migrate` command](https://docs.djangoproject.com/en/dev/topics/migrations/) to initialize ReactPy-Django's database table.
101101

102102
```bash linenums="0"
103103
python manage.py migrate
104104
```
105105

106106
## Step 6: Check your configuration
107107

108-
Run Django's [`check` command](https://docs.djangoproject.com/en/stable/ref/django-admin/#check) to verify if ReactPy was set up correctly.
108+
Run Django's [`check` command](https://docs.djangoproject.com/en/dev/ref/django-admin/#check) to verify if ReactPy was set up correctly.
109109

110110
```bash linenums="0"
111111
python manage.py check

docs/src/learn/your-first-component.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You will now need to pick at least one **Django app** to start using ReactPy-Dja
1818

1919
For the following examples, we will assume the following:
2020

21-
1. You have a **Django app** named `my_app`, which was created by Django's [`startapp` command](https://docs.djangoproject.com/en/stable/intro/tutorial01/#creating-the-polls-app).
21+
1. You have a **Django app** named `my_app`, which was created by Django's [`startapp` command](https://docs.djangoproject.com/en/dev/intro/tutorial01/#creating-the-polls-app).
2222
2. You have placed `my_app` directly into your **Django project** folder (`./example_project/my_app`). This is common for small projects.
2323

2424
??? question "How do I organize my Django project for ReactPy?"
@@ -72,19 +72,19 @@ Additionally, you can pass in `#!python args` and `#!python kwargs` into your co
7272

7373
??? question "Where is my templates folder?"
7474

75-
If you do not have a `./templates/` folder in your **Django app**, you can simply create one! Keep in mind, templates within this folder will not be detected by Django unless you [add the corresponding **Django app** to `settings.py:INSTALLED_APPS`](https://docs.djangoproject.com/en/stable/ref/applications/#configuring-applications).
75+
If you do not have a `./templates/` folder in your **Django app**, you can simply create one! Keep in mind, templates within this folder will not be detected by Django unless you [add the corresponding **Django app** to `settings.py:INSTALLED_APPS`](https://docs.djangoproject.com/en/dev/ref/applications/#configuring-applications).
7676

7777
## Setting up a Django view
7878

79-
Within your **Django app**'s `views.py` file, you will need to [create a view function](https://docs.djangoproject.com/en/stable/intro/tutorial01/#write-your-first-view) to render the HTML template `my-template.html` ([_from the previous step_](#embedding-in-a-template)).
79+
Within your **Django app**'s `views.py` file, you will need to [create a view function](https://docs.djangoproject.com/en/dev/intro/tutorial01/#write-your-first-view) to render the HTML template `my-template.html` ([_from the previous step_](#embedding-in-a-template)).
8080

8181
=== "views.py"
8282

8383
```python
8484
{% include "../../examples/python/example/views.py" %}
8585
```
8686

87-
We will add this new view into your [`urls.py`](https://docs.djangoproject.com/en/stable/intro/tutorial01/#write-your-first-view) and define what URL it should be accessible at.
87+
We will add this new view into your [`urls.py`](https://docs.djangoproject.com/en/dev/intro/tutorial01/#write-your-first-view) and define what URL it should be accessible at.
8888

8989
=== "urls.py"
9090

@@ -98,7 +98,7 @@ We will add this new view into your [`urls.py`](https://docs.djangoproject.com/e
9898

9999
Once you reach that point, we recommend creating an individual `urls.py` within each of your **Django apps**.
100100

101-
Then, within your **Django project's** `urls.py` you will use Django's [`include` function](https://docs.djangoproject.com/en/stable/ref/urls/#include) to link it all together.
101+
Then, within your **Django project's** `urls.py` you will use Django's [`include` function](https://docs.djangoproject.com/en/dev/ref/urls/#include) to link it all together.
102102

103103
## Viewing your component
104104

@@ -114,7 +114,7 @@ If you copy-pasted our example component, you will now see your component displa
114114

115115
??? warning "Do not use `manage.py runserver` for production"
116116

117-
This command is only intended for development purposes. For production deployments make sure to read [Django's documentation](https://docs.djangoproject.com/en/stable/howto/deployment/).
117+
This command is only intended for development purposes. For production deployments make sure to read [Django's documentation](https://docs.djangoproject.com/en/dev/howto/deployment/).
118118

119119
## Learn more
120120

docs/src/reference/components.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Automatically convert a Django view into a component.
1414

1515
At this time, this works best with static views with no interactivity.
1616

17-
Compatible with sync or async [Function Based Views](https://docs.djangoproject.com/en/stable/topics/http/views/) and [Class Based Views](https://docs.djangoproject.com/en/stable/topics/class-based-views/).
17+
Compatible with sync or async [Function Based Views](https://docs.djangoproject.com/en/dev/topics/http/views/) and [Class Based Views](https://docs.djangoproject.com/en/dev/topics/class-based-views/).
1818

1919
=== "components.py"
2020

@@ -144,7 +144,7 @@ Automatically convert a Django view into an [`iframe` element](https://www.techt
144144

145145
The contents of this `#!python iframe` is handled entirely by traditional Django view rendering. While this solution is compatible with more views than `#!python view_to_component`, it comes with different limitations.
146146

147-
Compatible with sync or async [Function Based Views](https://docs.djangoproject.com/en/stable/topics/http/views/) and [Class Based Views](https://docs.djangoproject.com/en/stable/topics/class-based-views/).
147+
Compatible with sync or async [Function Based Views](https://docs.djangoproject.com/en/dev/topics/http/views/) and [Class Based Views](https://docs.djangoproject.com/en/dev/topics/class-based-views/).
148148

149149
=== "components.py"
150150

@@ -273,7 +273,7 @@ Compatible with sync or async [Function Based Views](https://docs.djangoproject.
273273

274274
## Django CSS
275275

276-
Allows you to defer loading a CSS stylesheet until a component begins rendering. This stylesheet must be stored within [Django's static files](https://docs.djangoproject.com/en/stable/howto/static-files/).
276+
Allows you to defer loading a CSS stylesheet until a component begins rendering. This stylesheet must be stored within [Django's static files](https://docs.djangoproject.com/en/dev/howto/static-files/).
277277

278278
=== "components.py"
279279

@@ -326,7 +326,7 @@ Allows you to defer loading a CSS stylesheet until a component begins rendering.
326326

327327
## Django JS
328328

329-
Allows you to defer loading JavaScript until a component begins rendering. This JavaScript must be stored within [Django's static files](https://docs.djangoproject.com/en/stable/howto/static-files/).
329+
Allows you to defer loading JavaScript until a component begins rendering. This JavaScript must be stored within [Django's static files](https://docs.djangoproject.com/en/dev/howto/static-files/).
330330

331331
<!--
332332
TODO: This is no longer true since we don't insert elements on the page via JSON Patch anymore.

docs/src/reference/decorators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Decorator functions can be used within your `components.py` to help simplify dev
1212

1313
You can limit component access to users that pass a test function by using this decorator.
1414

15-
This decorator is inspired by Django's [`user_passes_test`](http://docs.djangoproject.com/en/stable/topics/auth/default/#django.contrib.auth.decorators.user_passes_test) decorator, but works with ReactPy components.
15+
This decorator is inspired by Django's [`user_passes_test`](http://docs.djangoproject.com/en/dev/topics/auth/default/#django.contrib.auth.decorators.user_passes_test) decorator, but works with ReactPy components.
1616

1717
=== "components.py"
1818

docs/src/reference/hooks.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Query functions can be sync or async.
7575

7676
<font size="4">**`#!python thread_sensitive`**</font>
7777

78-
Whether to run your synchronous query function in thread-sensitive mode. Thread-sensitive mode is turned on by default due to Django ORM limitations. See Django's [`sync_to_async` docs](https://docs.djangoproject.com/en/stable/topics/async/#sync-to-async) docs for more information.
78+
Whether to run your synchronous query function in thread-sensitive mode. Thread-sensitive mode is turned on by default due to Django ORM limitations. See Django's [`sync_to_async` docs](https://docs.djangoproject.com/en/dev/topics/async/#sync-to-async) docs for more information.
7979

8080
This setting only applies to sync query functions, and will be ignored for async functions.
8181

@@ -132,7 +132,7 @@ Query functions can be sync or async.
132132
{% include "../../examples/python/use-query-postprocessor-kwargs.py" %}
133133
```
134134

135-
_Note: In Django's ORM design, the field name to access foreign keys is [postfixed with `_set`](https://docs.djangoproject.com/en/stable/topics/db/examples/many_to_one/) by default._
135+
_Note: In Django's ORM design, the field name to access foreign keys is [postfixed with `_set`](https://docs.djangoproject.com/en/dev/topics/db/examples/many_to_one/) by default._
136136

137137
??? question "Can I make ORM calls without hooks?"
138138

@@ -160,7 +160,7 @@ Query functions can be sync or async.
160160

161161
This design decision was based on [Apollo's `#!javascript useQuery` hook](https://www.apollographql.com/docs/react/data/queries/), but ultimately helps avoid Django's `#!python SynchronousOnlyOperation` exceptions.
162162

163-
With the `#!python Model` or `#!python QuerySet` your function returns, this hook uses the [default postprocessor](../reference/utils.md#django-query-postprocessor) to ensure that all [deferred](https://docs.djangoproject.com/en/stable/ref/models/instances/#django.db.models.Model.get_deferred_fields) or [lazy](https://docs.djangoproject.com/en/stable/topics/db/queries/#querysets-are-lazy) fields are executed.
163+
With the `#!python Model` or `#!python QuerySet` your function returns, this hook uses the [default postprocessor](../reference/utils.md#django-query-postprocessor) to ensure that all [deferred](https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.get_deferred_fields) or [lazy](https://docs.djangoproject.com/en/dev/topics/db/queries/#querysets-are-lazy) fields are executed.
164164

165165
---
166166

@@ -219,7 +219,7 @@ Mutation functions can be sync or async.
219219

220220
<font size="4">**`#!python thread_sensitive`**</font>
221221

222-
Whether to run your synchronous mutation function in thread-sensitive mode. Thread-sensitive mode is turned on by default due to Django ORM limitations. See Django's [`sync_to_async` docs](https://docs.djangoproject.com/en/stable/topics/async/#sync-to-async) docs for more information.
222+
Whether to run your synchronous mutation function in thread-sensitive mode. Thread-sensitive mode is turned on by default due to Django ORM limitations. See Django's [`sync_to_async` docs](https://docs.djangoproject.com/en/dev/topics/async/#sync-to-async) docs for more information.
223223

224224
This setting only applies to sync query functions, and will be ignored for async functions.
225225

docs/src/reference/settings.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Dotted path to the Django authentication backend to use for ReactPy components.
7171

7272
Enabling this will cause component WebSocket connections to automatically [re-login](https://channels.readthedocs.io/en/latest/topics/authentication.html#how-to-log-a-user-in-out) users that are already authenticated.
7373

74-
This is useful to continuously update `#!python last_login` timestamps and refresh the [Django login session](https://docs.djangoproject.com/en/stable/topics/http/sessions/).
74+
This is useful to continuously update `#!python last_login` timestamps and refresh the [Django login session](https://docs.djangoproject.com/en/dev/topics/http/sessions/).
7575

7676
---
7777

@@ -105,7 +105,7 @@ If configuring this value, it is mandatory to enable our database router like su
105105

106106
Cache used by ReactPy, typically for caching disk operations.
107107

108-
We recommend using [`redis`](https://docs.djangoproject.com/en/stable/topics/cache/#redis), [`memcache`](https://docs.djangoproject.com/en/stable/topics/cache/#memcached), or [`local-memory caching`](https://docs.djangoproject.com/en/stable/topics/cache/#local-memory-caching).
108+
We recommend using [`redis`](https://docs.djangoproject.com/en/dev/topics/cache/#redis), [`memcache`](https://docs.djangoproject.com/en/dev/topics/cache/#memcached), or [`local-memory caching`](https://docs.djangoproject.com/en/dev/topics/cache/#local-memory-caching).
109109

110110
---
111111

docs/src/reference/utils.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ It is mandatory to use this function alongside [`view_to_iframe`](../reference/c
3838

3939
??? warning "Only use this within `#!python MyAppConfig.ready()`"
4040

41-
You should always call `#!python register_iframe` within a Django [`MyAppConfig.ready()` method](https://docs.djangoproject.com/en/stable/ref/applications/#django.apps.AppConfig.ready). This ensures you will retain multiprocessing compatibility, such as with ASGI web server workers.
41+
You should always call `#!python register_iframe` within a Django [`MyAppConfig.ready()` method](https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig.ready). This ensures you will retain multiprocessing compatibility, such as with ASGI web server workers.
4242

4343
---
4444

@@ -68,7 +68,7 @@ Typically, this function is automatically called on all components contained wit
6868

6969
??? warning "Only use this within `#!python MyAppConfig.ready()`"
7070

71-
You should always call `#!python register_component` within a Django [`MyAppConfig.ready()` method](https://docs.djangoproject.com/en/stable/ref/applications/#django.apps.AppConfig.ready). This ensures you will retain multiprocessing compatibility, such as with ASGI web server workers.
71+
You should always call `#!python register_component` within a Django [`MyAppConfig.ready()` method](https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig.ready). This ensures you will retain multiprocessing compatibility, such as with ASGI web server workers.
7272

7373
??? question "Do I need to use this?"
7474

@@ -84,7 +84,7 @@ Typically, this function is automatically called on all components contained wit
8484

8585
This is the default postprocessor for the `#!python use_query` hook.
8686

87-
Since ReactPy is rendered within an `#!python asyncio` loop, this postprocessor is exists to prevent Django's `#!python SynchronousOnlyException` by recursively prefetching fields within a `#!python Model` or `#!python QuerySet`. This prefetching step works to eliminate Django's [lazy execution](https://docs.djangoproject.com/en/stable/topics/db/queries/#querysets-are-lazy) behavior.
87+
Since ReactPy is rendered within an `#!python asyncio` loop, this postprocessor is exists to prevent Django's `#!python SynchronousOnlyException` by recursively prefetching fields within a `#!python Model` or `#!python QuerySet`. This prefetching step works to eliminate Django's [lazy execution](https://docs.djangoproject.com/en/dev/topics/db/queries/#querysets-are-lazy) behavior.
8888

8989
=== "components.py"
9090

src/reactpy_django/database.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def db_for_write(self, model, **hints):
2121

2222
def allow_relation(self, obj1, obj2, **hints):
2323
"""Returning `None` only allow relations within the same database.
24-
https://docs.djangoproject.com/en/stable/topics/db/multi-db/#limitations-of-multiple-databases
24+
https://docs.djangoproject.com/en/dev/topics/db/multi-db/#limitations-of-multiple-databases
2525
"""
2626
return None
2727

0 commit comments

Comments
 (0)