GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - reactive-python/reactpy-django: Django integration for ReactPy

BranchesTags
Open more actions menu

Latest commit

 

History

250 Commits
250 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.mailmap
.mailmap
 
 
.prettierrc
.prettierrc
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

ReactPy-Django

ReactPy-Django is used to add ReactPy support to an existing Django project. This package also turbocharges ReactPy with features such as...

  • SEO compatible rendering
  • Client-Side Python components
  • Single page application (SPA) capabilities
  • Distributed computing
  • Performance enhancements
  • Customizable reconnection behavior
  • Customizable disconnection behavior
  • Multiple root components
  • Cross-process communication/signaling
  • Django view to ReactPy component conversion
  • Django form to ReactPy component conversion
  • Django static file access
  • Django database access

What is ReactPy?

ReactPy 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. 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.

Supported Backends
Built-in External
Flask, FastAPI, Sanic, Tornado Django, Jupyter, Plotly-Dash

At a Glance

my_app/components.py

You will need a file to define your 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.

from reactpy import component, html

@component
def hello_world(recipient: str):
    return html.h1(f"Hello {recipient}!")

my_app/templates/my_template.html

In 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.

Additionally, 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.

<!DOCTYPE html>
{% load reactpy %}
<html>
  <body>
    {% component "example_project.my_app.components.hello_world" recipient="World" %}
  </body>
</html>

Resources

Follow the links below to find out more about this project.

  • Try ReactPy (Jupyter Notebook)
  • Documentation
  • GitHub Discussions
  • Discord
  • Contributor Guide
  • Code of Conduct

About

Django integration for ReactPy

reactive-python.github.io/reactpy-django/

Topics

djangohtmlpythonreactreactjsreactpy

Resources

Readme
MIT license

Code of conduct

Code of conduct
Activity
Custom properties

Stars

359 stars

Watchers

10 watching

Forks

22 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.