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
Django-IDOM connects your Python project to a ReactJS front-end, allowing you to createinteractive websites without needing JavaScript!
Following ReactJS styling, web elements are combined intoreusable "components". These components can utilizehooks andevents to create infinitely complex web pages.
When needed, IDOM canuse components directly from NPM. For additional flexibility, components can also befully developed in JavaScript.
Any Python web framework with Websockets can support IDOM. See below for what frameworks are supported out of the box.
Supported Frameworks | Supported Frameworks (External) |
---|---|
Flask ,FastAPI ,Sanic ,Tornado | Django ,Plotly-Dash ,Jupyter |
You will need a file to define yourIDOM components. We recommend creating acomponents.py
file within your chosenDjango app to start out. Within this file, we will create a simplehello_world
component.
fromidomimportcomponent,html@componentdefhello_world(recipient:str):returnhtml.h1(f"Hello{recipient}!")
In yourDjango app's HTML template, you can now embed your IDOM component using thecomponent
template tag. Within this tag, you will need to type in your dotted path to the component function as the first argument.
Additionally, you can pass inargs
andkwargs
into your component function. For example, after reading the code below, pay attention to how the function definition forhello_world
(in the previous example) accepts arecipient
argument.
{%loadidom%}<!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.
- Try it Now - Check out IDOM in a Jupyter Notebook.
- Documentation - Learn how to install, run, and use IDOM.
- Community Forum - Ask questions, share ideas, and show off projects.
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.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.