Skip to content

Commit

Permalink
Deployed a85164c to develop with MkDocs 1.6.1 and mike 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Dec 2, 2024
1 parent 03c16c7 commit a9214be
Show file tree
Hide file tree
Showing 15 changed files with 275 additions and 253 deletions.
2 changes: 1 addition & 1 deletion develop/about/changelog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

If you see this page, you probably meant to visit the other CHANGELOG.md (all caps).

--> <p class=intro> The format is based on <a href=https://keepachangelog.com/en/1.0.0/ >Keep a Changelog</a>, and this project adheres to <a href=https://semver.org/spec/v2.0.0.html>Semantic Versioning</a>. </p> <hr> <h2 id=unreleased><a href=https://github.com/reactive-python/reactpy-django/compare/5.1.0...HEAD>Unreleased</a><a class=headerlink href=#unreleased title="Permanent link">&para;</a></h2> <h3 id=fixed>Fixed<a class=headerlink href=#fixed title="Permanent link">&para;</a></h3> <ul> <li>Fixed regression in v5.1.0 where components would sometimes not output debug messages when <code>settings.py:DEBUG</code> is enabled.</li> </ul> <h3 id=changed>Changed<a class=headerlink href=#changed title="Permanent link">&para;</a></h3> <ul> <li>Set upper limit on ReactPy version to <code>&lt;2.0.0</code>.</li> </ul> <h2 id=510-2024-11-24><a href=https://github.com/reactive-python/reactpy-django/compare/5.0.0...5.1.0>5.1.0</a> - 2024-11-24<a class=headerlink href=#510-2024-11-24 title="Permanent link">&para;</a></h2> <h3 id=added>Added<a class=headerlink href=#added title="Permanent link">&para;</a></h3> <ul> <li><code>settings.py:REACTPY_ASYNC_RENDERING</code> to enable asynchronous rendering of components.</li> </ul> <h3 id=changed_1>Changed<a class=headerlink href=#changed_1 title="Permanent link">&para;</a></h3> <ul> <li>Bumped the minimum ReactPy version to <code>1.1.0</code>.</li> </ul> <h2 id=500-2024-10-22><a href=https://github.com/reactive-python/reactpy-django/compare/4.0.0...5.0.0>5.0.0</a> - 2024-10-22<a class=headerlink href=#500-2024-10-22 title="Permanent link">&para;</a></h2> <h3 id=changed_2>Changed<a class=headerlink href=#changed_2 title="Permanent link">&para;</a></h3> <ul> <li>Now using ReactPy-Router v1 for URL routing, which comes with a slightly different API than before.</li> <li>Removed dependency on <code>aiofile</code>.</li> </ul> <h3 id=removed>Removed<a class=headerlink href=#removed title="Permanent link">&para;</a></h3> <ul> <li>Removed the following <strong>deprecated</strong> features:<ul> <li>The <code>compatibility</code> argument on <code>reactpy_django.components.view_to_component</code></li> <li><code>reactpy_django.components.view_to_component</code> <strong>usage as a decorator</strong></li> <li><code>reactpy_django.decorators.auth_required</code></li> <li><code>reactpy_django.REACTPY_WEBSOCKET_PATH</code></li> <li><code>settings.py:REACTPY_WEBSOCKET_URL</code></li> </ul> </li> </ul> <h2 id=400-2024-06-22><a href=https://github.com/reactive-python/reactpy-django/compare/3.8.1...4.0.0>4.0.0</a> - 2024-06-22<a class=headerlink href=#400-2024-06-22 title="Permanent link">&para;</a></h2> <h3 id=added_1>Added<a class=headerlink href=#added_1 title="Permanent link">&para;</a></h3> <ul> <li>Client-side Python components can now be rendered via the new <code>{% pyscript_component %}</code> template tag<ul> <li>You must first call the <code>{% pyscript_setup %}</code> template tag to load PyScript dependencies</li> </ul> </li> <li>Client-side components can be embedded into existing server-side components via <code>reactpy_django.components.pyscript_component</code>.</li> <li>Tired of writing JavaScript? You can now write PyScript code that runs directly within client browser via the <code>reactpy_django.html.pyscript</code> element.<ul> <li>This is a viable substitution for most JavaScript code.</li> </ul> </li> </ul> <h3 id=changed_3>Changed<a class=headerlink href=#changed_3 title="Permanent link">&para;</a></h3> <ul> <li> <p>New syntax for <code>use_query</code> and <code>use_mutation</code> hooks. Here's a quick comparison of the changes:</p> <div class=highlight><table class=highlighttable><tr><td class=linenos><div class=linenodiv><pre><span></span><span class=normal>1</span>
--> <p class=intro> The format is based on <a href=https://keepachangelog.com/en/1.0.0/ >Keep a Changelog</a>, and this project adheres to <a href=https://semver.org/spec/v2.0.0.html>Semantic Versioning</a>. </p> <hr> <h2 id=unreleased><a href=https://github.com/reactive-python/reactpy-django/compare/5.1.0...HEAD>Unreleased</a><a class=headerlink href=#unreleased title="Permanent link">&para;</a></h2> <h3 id=fixed>Fixed<a class=headerlink href=#fixed title="Permanent link">&para;</a></h3> <ul> <li>Fixed regression in v5.1.0 where components would sometimes not output debug messages when <code>settings.py:DEBUG</code> is enabled.</li> </ul> <h3 id=changed>Changed<a class=headerlink href=#changed title="Permanent link">&para;</a></h3> <ul> <li>Set upper limit on ReactPy version to <code>&lt;2.0.0</code>.</li> <li>ReactPy web modules are now streamed in chunks.</li> <li>ReactPy web modules are now streamed using asynchronous file reading to improve performance.</li> <li>Performed refactoring to utilize <code>ruff</code> as this repository's linter.</li> </ul> <h2 id=510-2024-11-24><a href=https://github.com/reactive-python/reactpy-django/compare/5.0.0...5.1.0>5.1.0</a> - 2024-11-24<a class=headerlink href=#510-2024-11-24 title="Permanent link">&para;</a></h2> <h3 id=added>Added<a class=headerlink href=#added title="Permanent link">&para;</a></h3> <ul> <li><code>settings.py:REACTPY_ASYNC_RENDERING</code> to enable asynchronous rendering of components.</li> </ul> <h3 id=changed_1>Changed<a class=headerlink href=#changed_1 title="Permanent link">&para;</a></h3> <ul> <li>Bumped the minimum ReactPy version to <code>1.1.0</code>.</li> </ul> <h2 id=500-2024-10-22><a href=https://github.com/reactive-python/reactpy-django/compare/4.0.0...5.0.0>5.0.0</a> - 2024-10-22<a class=headerlink href=#500-2024-10-22 title="Permanent link">&para;</a></h2> <h3 id=changed_2>Changed<a class=headerlink href=#changed_2 title="Permanent link">&para;</a></h3> <ul> <li>Now using ReactPy-Router v1 for URL routing, which comes with a slightly different API than before.</li> <li>Removed dependency on <code>aiofile</code>.</li> </ul> <h3 id=removed>Removed<a class=headerlink href=#removed title="Permanent link">&para;</a></h3> <ul> <li>Removed the following <strong>deprecated</strong> features:<ul> <li>The <code>compatibility</code> argument on <code>reactpy_django.components.view_to_component</code></li> <li><code>reactpy_django.components.view_to_component</code> <strong>usage as a decorator</strong></li> <li><code>reactpy_django.decorators.auth_required</code></li> <li><code>reactpy_django.REACTPY_WEBSOCKET_PATH</code></li> <li><code>settings.py:REACTPY_WEBSOCKET_URL</code></li> </ul> </li> </ul> <h2 id=400-2024-06-22><a href=https://github.com/reactive-python/reactpy-django/compare/3.8.1...4.0.0>4.0.0</a> - 2024-06-22<a class=headerlink href=#400-2024-06-22 title="Permanent link">&para;</a></h2> <h3 id=added_1>Added<a class=headerlink href=#added_1 title="Permanent link">&para;</a></h3> <ul> <li>Client-side Python components can now be rendered via the new <code>{% pyscript_component %}</code> template tag<ul> <li>You must first call the <code>{% pyscript_setup %}</code> template tag to load PyScript dependencies</li> </ul> </li> <li>Client-side components can be embedded into existing server-side components via <code>reactpy_django.components.pyscript_component</code>.</li> <li>Tired of writing JavaScript? You can now write PyScript code that runs directly within client browser via the <code>reactpy_django.html.pyscript</code> element.<ul> <li>This is a viable substitution for most JavaScript code.</li> </ul> </li> </ul> <h3 id=changed_3>Changed<a class=headerlink href=#changed_3 title="Permanent link">&para;</a></h3> <ul> <li> <p>New syntax for <code>use_query</code> and <code>use_mutation</code> hooks. Here's a quick comparison of the changes:</p> <div class=highlight><table class=highlighttable><tr><td class=linenos><div class=linenodiv><pre><span></span><span class=normal>1</span>
<span class=normal>2</span>
<span class=normal>3</span>
<span class=normal>4</span>
Expand Down
2 changes: 1 addition & 1 deletion develop/about/contributing/index.html

Large diffs are not rendered by default.

26 changes: 11 additions & 15 deletions develop/learn/add-reactpy-to-a-django-project/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
<span class=normal>16</span>
<span class=normal>17</span>
<span class=normal>18</span>
<span class=normal>19</span>
<span class=normal>20</span></pre></div></td><td class=code><div><pre><span></span><code><span class=kn>import</span> <span class=nn>os</span>
<span class=normal>19</span></pre></div></td><td class=code><div><pre><span></span><code><span class=kn>import</span> <span class=nn>os</span>

<span class=kn>from</span> <span class=nn>django.core.asgi</span> <span class=kn>import</span> <span class=n>get_asgi_application</span>

Expand All @@ -53,22 +52,19 @@


<span class=kn>from</span> <span class=nn>channels.routing</span> <span class=kn>import</span> <span class=n>ProtocolTypeRouter</span><span class=p>,</span> <span class=n>URLRouter</span> <span class=c1># noqa: E402</span>

<span class=kn>from</span> <span class=nn>reactpy_django</span> <span class=kn>import</span> <span class=n>REACTPY_WEBSOCKET_ROUTE</span> <span class=c1># noqa: E402</span>

<span class=n>application</span> <span class=o>=</span> <span class=n>ProtocolTypeRouter</span><span class=p>(</span>
<span class=p>{</span>
<span class=s2>&quot;http&quot;</span><span class=p>:</span> <span class=n>django_asgi_app</span><span class=p>,</span>
<span class=s2>&quot;websocket&quot;</span><span class=p>:</span> <span class=n>URLRouter</span><span class=p>([</span><span class=n>REACTPY_WEBSOCKET_ROUTE</span><span class=p>]),</span>
<span class=p>}</span>
<span class=p>)</span>
<span class=n>application</span> <span class=o>=</span> <span class=n>ProtocolTypeRouter</span><span class=p>({</span>
<span class=s2>&quot;http&quot;</span><span class=p>:</span> <span class=n>django_asgi_app</span><span class=p>,</span>
<span class=s2>&quot;websocket&quot;</span><span class=p>:</span> <span class=n>URLRouter</span><span class=p>([</span><span class=n>REACTPY_WEBSOCKET_ROUTE</span><span class=p>]),</span>
<span class=p>})</span>
</code></pre></div></td></tr></table></div> </div> </div> </div> <details class=info> <summary>Add <code class=highlight><span class=n>AuthMiddlewareStack</span></code> (Optional)</summary> <p>There are many situations where you need to access the Django <code class=highlight><span class=n>User</span></code> or <code class=highlight><span class=n>Session</span></code> objects within ReactPy components. For example, if you want to:</p> <ol> <li>Access the <code class=highlight><span class=n>User</span></code> that is currently logged in</li> <li>Access Django's <code class=highlight><span class=n>Session</span></code> object</li> <li>Login or logout the current <code class=highlight><span class=n>User</span></code></li> </ol> <p>In these situations will need to ensure you are using <code class=highlight><span class=n>AuthMiddlewareStack</span></code>.</p> <div class=highlight><pre><span></span><code><span class=kn>from</span> <span class=nn>channels.auth</span> <span class=kn>import</span> <span class=n>AuthMiddlewareStack</span> <span class=c1># noqa: E402</span>

<span class=n>application</span> <span class=o>=</span> <span class=n>ProtocolTypeRouter</span><span class=p>(</span>
<span class=p>{</span>
<span class=s2>&quot;http&quot;</span><span class=p>:</span> <span class=n>django_asgi_app</span><span class=p>,</span>
<span class=s2>&quot;websocket&quot;</span><span class=p>:</span> <span class=n>AuthMiddlewareStack</span><span class=p>(</span><span class=n>URLRouter</span><span class=p>([</span><span class=n>REACTPY_WEBSOCKET_ROUTE</span><span class=p>])),</span>
<span class=p>}</span>
<span class=p>)</span>
<span class=n>application</span> <span class=o>=</span> <span class=n>ProtocolTypeRouter</span><span class=p>({</span>
<span class=s2>&quot;http&quot;</span><span class=p>:</span> <span class=n>django_asgi_app</span><span class=p>,</span>
<span class=s2>&quot;websocket&quot;</span><span class=p>:</span> <span class=n>AuthMiddlewareStack</span><span class=p>(</span><span class=n>URLRouter</span><span class=p>([</span><span class=n>REACTPY_WEBSOCKET_ROUTE</span><span class=p>])),</span>
<span class=p>})</span>
</code></pre></div> </details> <details class=question> <summary>Where is my <code>asgi.py</code>?</summary> <p>If you do not have an <code>asgi.py</code>, follow the <a href=https://channels.readthedocs.io/en/stable/installation.html><code>channels</code> installation guide</a>.</p> </details> <h2 id=step-5-run-database-migrations>Step 5: Run database migrations<a class=headerlink href=#step-5-run-database-migrations title="Permanent link">&para;</a></h2> <p>Run Django's <a href=https://docs.djangoproject.com/en/stable/topics/migrations/ ><code>migrate</code> command</a> to initialize ReactPy-Django's database table.</p> <div class=highlight><pre><span></span><code>python<span class=w> </span>manage.py<span class=w> </span>migrate
</code></pre></div> <h2 id=step-6-check-your-configuration>Step 6: Check your configuration<a class=headerlink href=#step-6-check-your-configuration title="Permanent link">&para;</a></h2> <p>Run Django's <a href=https://docs.djangoproject.com/en/stable/ref/django-admin/#check><code>check</code> command</a> to verify if ReactPy was set up correctly.</p> <div class=highlight><pre><span></span><code>python<span class=w> </span>manage.py<span class=w> </span>check
</code></pre></div> <h2 id=step-7-create-your-first-component>Step 7: Create your first component<a class=headerlink href=#step-7-create-your-first-component title="Permanent link">&para;</a></h2> <p>The <a href=../your-first-component/ >next page</a> will show you how to create your first ReactPy component.</p> <p>Prefer a quick summary? Read the <strong>At a Glance</strong> section below.</p> <div class="admonition info"> <p class=admonition-title>At a Glance</p> <p><font size=5><strong><code>my_app/components.py</code></strong></font></p> <p>You will need a file to define your <a href=https://github.com/reactive-python/reactpy>ReactPy</a> components. We recommend creating a <code>components.py</code> file within your chosen <strong>Django app</strong> to start out. Within this file, we will create a simple <code>hello_world</code> component.</p> <p><!--py-header-end--> <!--py-code-start--></p> <div class=highlight><table class=highlighttable><tr><td class=linenos><div class=linenodiv><pre><span></span><span class=normal>1</span>
Expand All @@ -93,4 +89,4 @@
<span class=x> </span><span class=cp>{%</span> <span class=k>component</span> <span class=s2>&quot;example_project.my_app.components.hello_world&quot;</span> <span class=nv>recipient</span><span class=o>=</span><span class=s2>&quot;World&quot;</span> <span class=cp>%}</span>
<span class=x> &lt;/body&gt;</span>
<span class=x>&lt;/html&gt;</span>
</code></pre></div></td></tr></table></div> </div> <hr> <div class=md-source-file> <small> Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">October 22, 2024</span> </small> </div> <div class=md-source-date> <small> Authors: <span class="git-page-authors git-authors"><a href=mailto:[email protected]>Mark Bakhit</a></span> </small> </div> </article> </div> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> &copy; <div id=year></div> <script>document.getElementById("year").innerHTML = new Date().getFullYear();</script> Reactive Python and affiliates. <div class=legal-footer-right>This project has no affiliation to ReactJS or Meta Platforms, Inc.</div> </div> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "../..", "features": ["navigation.instant", "navigation.tabs", "navigation.tabs.sticky", "navigation.top", "content.code.copy", "search.highlight"], "search": "../../assets/javascripts/workers/search.a264c092.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script> <script src=../../assets/javascripts/bundle.4e0fa4ba.min.js></script> <script src=../../assets/js/main.js></script> </body> </html>
</code></pre></div></td></tr></table></div> </div> <hr> <div class=md-source-file> <small> Last update: <span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">December 2, 2024</span> </small> </div> <div class=md-source-date> <small> Authors: <span class="git-page-authors git-authors"><a href=mailto:[email protected]>Mark Bakhit</a></span> </small> </div> </article> </div> </div> <button type=button class="md-top md-icon" data-md-component=top hidden> <svg xmlns=http://www.w3.org/2000/svg viewbox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12Z"/></svg> Back to top </button> </main> <footer class=md-footer> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class=md-copyright> <div class=md-copyright__highlight> &copy; <div id=year></div> <script>document.getElementById("year").innerHTML = new Date().getFullYear();</script> Reactive Python and affiliates. <div class=legal-footer-right>This project has no affiliation to ReactJS or Meta Platforms, Inc.</div> </div> </div> </div> </div> </footer> </div> <div class=md-dialog data-md-component=dialog> <div class="md-dialog__inner md-typeset"></div> </div> <script id=__config type=application/json>{"base": "../..", "features": ["navigation.instant", "navigation.tabs", "navigation.tabs.sticky", "navigation.top", "content.code.copy", "search.highlight"], "search": "../../assets/javascripts/workers/search.a264c092.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script> <script src=../../assets/javascripts/bundle.4e0fa4ba.min.js></script> <script src=../../assets/js/main.js></script> </body> </html>
Loading

0 comments on commit a9214be

Please sign in to comment.