Skip to main content

Control the web with Python

Project description

ReactPy Django

Tests PyPI Version License Docs

ReactPy is a library for building user interfaces in Python without Javascript. ReactPy interfaces are made from components which look and behave similarly to those found in ReactJS. 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

At a Glance

my_app/components.py

You will need a file to define your ReactPy 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 reactpy 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 ReactPy 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 reactpy %}
<!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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reactpy_django-3.0.0a4.tar.gz (74.5 kB view details)

Uploaded Source

Built Distribution

reactpy_django-3.0.0a4-py2.py3-none-any.whl (77.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file reactpy_django-3.0.0a4.tar.gz.

File metadata

  • Download URL: reactpy_django-3.0.0a4.tar.gz
  • Upload date:
  • Size: 74.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for reactpy_django-3.0.0a4.tar.gz
Algorithm Hash digest
SHA256 e77d47dea8f61c98a38216ef68df4238e5a15a233d57d7340295e3bf8f13b061
MD5 4f134b900bc18d80794ea350829f592a
BLAKE2b-256 216cdde6a82ca25dc5d4d339b9b99f7835f1c40991bda4c6acf5d199bd0d1511

See more details on using hashes here.

File details

Details for the file reactpy_django-3.0.0a4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for reactpy_django-3.0.0a4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1d5af905ae772da8babb2c0008116e8a44a2291eb5d0e8968ad444bc3b926648
MD5 f23580f828f44385fadcb418c38d4d98
BLAKE2b-256 3d21d9ae80dd57d579496db8cc1bc78d08791e286509e6a8dbfa09d9ddb0c2e6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page