{"id":16417531,"url":"https://github.com/reactive-python/reactpy-django","last_synced_at":"2025-10-26T20:30:47.209Z","repository":{"id":38394220,"uuid":"367981791","full_name":"reactive-python/reactpy-django","owner":"reactive-python","description":"It's React, but in Python. Now with Django integration.","archived":false,"fork":false,"pushed_at":"2025-01-11T03:43:34.000Z","size":4503,"stargazers_count":333,"open_issues_count":19,"forks_count":19,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-01-20T23:49:51.120Z","etag":null,"topics":["django","html","python","react","reactjs","reactpy"],"latest_commit_sha":null,"homepage":"https://reactive-python.github.io/reactpy-django/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reactive-python.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["archmonger"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-05-16T20:45:39.000Z","updated_at":"2025-01-19T12:51:21.000Z","dependencies_parsed_at":"2023-07-26T17:45:16.153Z","dependency_job_id":"62c92806-a4f6-4636-9876-883089bdbb95","html_url":"https://github.com/reactive-python/reactpy-django","commit_stats":null,"previous_names":["idom-team/django-idom"],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-python%2Freactpy-django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-python%2Freactpy-django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-python%2Freactpy-django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactive-python%2Freactpy-django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactive-python","download_url":"https://codeload.github.com/reactive-python/reactpy-django/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238394323,"owners_count":19464583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","html","python","react","reactjs","reactpy"],"created_at":"2024-10-11T07:11:33.761Z","updated_at":"2025-10-26T20:30:47.204Z","avatar_url":"https://github.com/reactive-python.png","language":"Python","readme":"# \u003cimg src=\"https://raw.githubusercontent.com/reactive-python/reactpy/main/branding/svg/reactpy-logo-square.svg\" align=\"left\" height=\"45\"/\u003e ReactPy-Django\n\n\u003cp\u003e\n    \u003ca href=\"https://github.com/reactive-python/reactpy-django/actions/workflows/test-python.yml\"\u003e\n        \u003cimg src=\"https://github.com/reactive-python/reactpy-django/actions/workflows/test-python.yml/badge.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.python.org/pypi/reactpy-django\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/reactpy-django.svg?label=PyPI\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/reactive-python/reactpy-django/blob/main/LICENSE.md\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-MIT-purple.svg\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://reactive-python.github.io/reactpy-django/\"\u003e\n        \u003cimg src=\"https://img.shields.io/website?down_message=offline\u0026label=Docs\u0026logo=read%20the%20docs\u0026logoColor=white\u0026up_message=online\u0026url=https%3A%2F%2Freactive-python.github.io%2Freactpy-django%2F\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://discord.gg/uNb5P4hA9X\"\u003e\n        \u003cimg src=\"https://img.shields.io/discord/1111078259854168116?label=Discord\u0026logo=discord\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n[ReactPy-Django](https://github.com/reactive-python/reactpy-django) is used to add [ReactPy](https://reactpy.dev/) support to an existing **Django project**. This package also turbocharges ReactPy with features such as...\n\n-   [SEO compatible rendering](https://reactive-python.github.io/reactpy-django/latest/reference/settings/#reactpy_prerender)\n-   [Client-Side Python components](https://reactive-python.github.io/reactpy-django/latest/reference/template-tag/#pyscript-component)\n-   [Single page application (SPA) capabilities](https://reactive-python.github.io/reactpy-django/latest/reference/router/#django-router)\n-   [Distributed computing](https://reactive-python.github.io/reactpy-django/latest/reference/settings/#reactpy_default_hosts)\n-   [Performance enhancements](https://reactive-python.github.io/reactpy-django/latest/reference/settings/#performance-settings)\n-   [Customizable reconnection behavior](https://reactive-python.github.io/reactpy-django/latest/reference/settings/#stability-settings)\n-   [Customizable disconnection behavior](https://reactive-python.github.io/reactpy-django/latest/reference/template-tag)\n-   [Multiple root components](https://reactive-python.github.io/reactpy-django/latest/reference/template-tag/)\n-   [Cross-process communication/signaling](https://reactive-python.github.io/reactpy-django/latest/reference/hooks/#use-channel-layer)\n-   [Django view to ReactPy component conversion](https://reactive-python.github.io/reactpy-django/latest/reference/components/#view-to-component)\n-   [Django form to ReactPy component conversion](https://reactive-python.github.io/reactpy-django/latest/reference/components/#django-form)\n-   [Django static file access](https://reactive-python.github.io/reactpy-django/latest/reference/components/#django-css)\n-   [Django database access](https://reactive-python.github.io/reactpy-django/latest/reference/hooks/#use-query)\n\n## What is ReactPy?\n\n[ReactPy](https://reactpy.dev/) is a library for building user interfaces in Python without Javascript. ReactPy interfaces are made from components that look and behave similar to those found in [ReactJS](https://reactjs.org/). Designed with simplicity in mind, ReactPy can be used by those without web development experience while also being powerful enough to grow with your ambitions.\n\n\u003ctable align=\"center\"\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth colspan=\"2\" style=\"text-align: center\"\u003eSupported Backends\u003c/th\u003e\n        \u003ctr\u003e\n            \u003cth style=\"text-align: center\"\u003eBuilt-in\u003c/th\u003e\n            \u003cth style=\"text-align: center\"\u003eExternal\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://reactpy.dev/docs/guides/getting-started/installing-reactpy.html#officially-supported-servers\"\u003e\n                Flask, FastAPI, Sanic, Tornado\n            \u003c/a\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\n            \u003ca href=\"https://github.com/reactive-python/reactpy-django\"\u003eDjango\u003c/a\u003e,\n            \u003ca href=\"https://github.com/reactive-python/reactpy-jupyter\"\u003eJupyter\u003c/a\u003e,\n            \u003ca href=\"https://github.com/idom-team/idom-dash\"\u003ePlotly-Dash\u003c/a\u003e\n        \u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n# At a Glance\n\n## `my_app/components.py`\n\n\u003c!--py-header-start--\u003e\n\nYou will need a file to define your [ReactPy](https://github.com/reactive-python/reactpy) components. We recommend creating a `components.py` file within your chosen **Django app** to start out. Within this file, we will create a simple `hello_world` component.\n\n\u003c!--py-header-end--\u003e\n\u003c!--py-code-start--\u003e\n\n```python\nfrom reactpy import component, html\n\n@component\ndef hello_world(recipient: str):\n    return html.h1(f\"Hello {recipient}!\")\n```\n\n\u003c!--py-code-end--\u003e\n\n## [`my_app/templates/my_template.html`](https://docs.djangoproject.com/en/stable/topics/templates/)\n\n\u003c!--html-header-start--\u003e\n\nIn your **Django app**'s HTML template, you can now embed your ReactPy component using the `component` template tag. Within this tag, you will need to type in the dotted path to the component.\n\nAdditionally, you can pass in `args` and `kwargs` into your component function. After reading the code below, pay attention to how the function definition for `hello_world` (_from the previous example_) accepts a `recipient` argument.\n\n\u003c!--html-code-start--\u003e\n\n```jinja\n{% load reactpy %}\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003cbody\u003e\n    {% component \"example_project.my_app.components.hello_world\" recipient=\"World\" %}\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n\u003c!--html-code-end--\u003e\n\n# Resources\n\nFollow the links below to find out more about this project.\n\n-   [Try ReactPy (Jupyter Notebook)](https://mybinder.org/v2/gh/reactive-python/reactpy-jupyter/main?urlpath=lab/tree/notebooks/introduction.ipynb)\n-   [Documentation](https://reactive-python.github.io/reactpy-django)\n-   [GitHub Discussions](https://github.com/reactive-python/reactpy-django/discussions)\n-   [Discord](https://discord.gg/uNb5P4hA9X)\n-   [Contributor Guide](https://reactive-python.github.io/reactpy-django/latest/about/code/)\n-   [Code of Conduct](https://github.com/reactive-python/reactpy-django/blob/main/CODE_OF_CONDUCT.md)\n","funding_links":["https://github.com/sponsors/archmonger"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactive-python%2Freactpy-django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactive-python%2Freactpy-django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactive-python%2Freactpy-django/lists"}