Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork23
It's React, but in Python. Now with Django integration.
License
reactive-python/reactpy-django
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ReactPy-Django is used to addReactPy support to an existingDjango 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
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 inReactJS. 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 |
You will need a file to define yourReactPy components. We recommend creating acomponents.py
file within your chosenDjango app to start out. Within this file, we will create a simplehello_world
component.
fromreactpyimportcomponent,html@componentdefhello_world(recipient:str):returnhtml.h1(f"Hello{recipient}!")
In yourDjango app's HTML template, you can now embed your ReactPy component using thecomponent
template tag. Within this tag, you will need to type in the dotted path to the component.
Additionally, you can pass inargs
andkwargs
into your component function. After reading the code below, pay attention to how the function definition forhello_world
(from the previous example) accepts arecipient
argument.
{%loadreactpy%}<!DOCTYPE html><html> <body>{%component"example_project.my_app.components.hello_world"recipient="World"%} </body></html>
Follow the links below to find out more about this project.
About
It's React, but in Python. Now with Django integration.
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.