Control the web with Python
Project description
Django IDOM ·
Django-IDOM connects your Python project to a ReactJS frontend, allowing you to create interactive websites without needing JavaScript!
Following ReactJS styling, web elements are combined into reusable "components". These components can utilize hooks and events to create infinitely complex web pages.
When needed, IDOM can use components directly from NPM. For additional flexibility, components can also be fully 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 |
At a Glance
my_app/components.py
You'll need a file to define your IDOM components. We recommend creating a components.py
file within your chosen Django app to start out. Within this file, we will create a simple HelloWorld
component.
from idom import component, html
@component
def HelloWorld(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 IDOM component using the component
template tag. Within this tag, you will need to type in your dotted path to the component function as the first argument.
Additonally, you can pass in keyword arguments into your component function. For example, after reading the code below, pay attention to how the function definition for HelloWorld
(in the previous example) accepts a recipient
argument.
{% load idom %}
<!DOCTYPE html>
<html>
<body>
{% component "example_project.my_app.components.HelloWorld" recipient="World" %}
</body>
</html>
Resources
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_idom-1.1.0.tar.gz
.
File metadata
- Download URL: django_idom-1.1.0.tar.gz
- Upload date:
- Size: 261.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fb0c158a3f2b1a65b693b7a0fe67b417bca6f8c5b51e3bb4b8c2ee898cfeab1 |
|
MD5 | ca07185e31fdf542a924b5053f5fb9f3 |
|
BLAKE2b-256 | 7f85145b30ee77feeb78b57e3e0e027fcce670a60a67726abfad6d89040b785f |
File details
Details for the file django_idom-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: django_idom-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 267.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef7cceae27dbc5272f26f2a286402c360b305b17bcf63c1eec48ef265288b8d0 |
|
MD5 | 95823c030b0cc932ad8f5f61a64a9dfc |
|
BLAKE2b-256 | ffa0a3872fc8b3f063b8b6f2ec98155e3b4a8a446baa6e152999fd4d62626fa9 |