Skip to main content

Django-IDOM · Tests PyPI Version License Docs

Django-IDOM connects your Python project to a ReactJS front-end, 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 will 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 hello_world component.

from idom 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 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.

Additionally, you can pass in args and kwargs into your component function. For example, after reading the code below, pay attention to how the function definition for hello_world (in the previous example) accepts a recipient argument.

{% load idom %}
<!DOCTYPE html>
<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.

Metadata

Release files for django-idom 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-idom 3.0.1
File Size Uploaded
django_idom-3.0.1.tar.gz 74.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-idom 3.0.1
File Interpreter ABI Platform
django_idom-3.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 151.3 kB

Release files / django_idom-3.0.1.tar.gz

Download URL django_idom-3.0.1.tar.gz
Size 74.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d401405df13ace319a6c8dc4d7092a83feb6b556eb802065611facb62f6aa77c
BLAKE2b-256 checksum
How to use checksums
fc49e30ce46840f7c203ea829b0b7f8476eb347e8a3a8bb0d60efb8085a47aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / django_idom-3.0.1-py2.py3-none-any.whl

Download URL django_idom-3.0.1-py2.py3-none-any.whl
Size 76.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
91324a7fac75c7ca582498987173ba52d386edb1db084fd5d2e87dd9480216ab
BLAKE2b-256 checksum
How to use checksums
d541c162e53965dfe5660e58570e076a77479c93d47d8d1bcc8d1d095193d9a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page