- Notifications
You must be signed in to change notification settings - Fork0
It's React, but in Python. Now with Django integration.
License
ShaheedHaque/reactpy-django
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ReactPy-Django is used to add used to addReactPy support to an existingDjango project.
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.
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Languages
- Python84.9%
- HTML11.8%
- TypeScript2.7%
- Other0.6%