Skip to main content

It's React, but in Python. Now with Django integration.

Project description

ReactPy-Django

ReactPy-Django is used to add ReactPy support to an existing Django project. This package also turbocharges ReactPy with features such as...

What is ReactPy?

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 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 the dotted path to the component.

Additionally, you can pass in args and kwargs into your component function. After reading the code below, pay attention to how the function definition for hello_world (from 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-4.0.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

reactpy_django-4.0.0-py2.py3-none-any.whl (1.5 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file reactpy_django-4.0.0.tar.gz.

File metadata

  • Download URL: reactpy_django-4.0.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for reactpy_django-4.0.0.tar.gz
Algorithm Hash digest
SHA256 4ea174519360c1dc0dddee98e13a9a3f2452d3defe0c5b18f5e2fb5c637ef6f8
MD5 d864c90c4ccb972910a79d9488467df1
BLAKE2b-256 e253a831fa23c9fa7553e87a10f1a53cf16a342475789a30f50fbc697db20513

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reactpy_django-4.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 21a55fdfc80be7b3d0e0cc68b0e7b4ccd4fa0f564e7fe2fae678a8c306058f64
MD5 e744c2ab136a4d0f21e51def8048ea14
BLAKE2b-256 0bb3c7a91f87b8fea589eac1e1152ca6552d508cf81b31fdce843e2113aa3216

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