Skip to main content

Django integration for Frontend Bundlers & React

Project description

Alliance Platform Django Frontend

A library for integrating the Alliance Platform React library into a Django project.

Uses Vite to bundle Javascript and perform server-side rendering, and supplies a number of templatetags to easily embed Alliance Platform React components into Django templates.

Installation

pip install alliance-platform-frontend

System Requirements

  • Supports django 4.2 and 5.0
  • Python >=3.11

Usage

Alliance UI

A collection of built-in template tags for easily using Alliance UI React components in Django templates.

A templatetag (for example, Button) can be inserted in a template using the syntax:

{% Button variant="outlined" type="submit" %}Submit{% endButton %}

Components can be nested, e.g.

{% MenuBar %}
    {% Menubar.SubMenu %}
        {% Menubar.Item %}Item{% endMenubar.Item %}
    {% endMenubar.SubMenu %}
{% endMenuBar %}

Keyword arguments to the tag will be automatically passed as props to the React component.

Available Tags

  • Button
  • ButtonGroup
  • DatePicker
  • Icon
  • InlineAlert
  • Menubar
  • Menubar.SubMenu
  • Menubar.Item
  • Menubar.Section
  • Pagination
  • Table
  • TableHeader
  • TableBody
  • ColumnHeaderLink
  • Column
  • Row
  • Cell
  • TimeInput
  • Fragment
  • raw_html

The following functions are also available:

utils.get_module_import_source

Given the name of the export within alliance-platform-js/ui, creates the javascript import specification for the specified component.

Bundler

Templates

Template Tags

Release Process

Poetry Config

  • Add test repository
    • poetry config repositories.testpypi https://test.pypi.org/legacy/
    • Generate an account API token at https://test.pypi.org/manage/account/token/
    • poetry config pypi-token.testpypi ${TOKEN}
      • On macs this will be stored in the login keychain at poetry-repository-testpypi
  • Main pypi repository

Publishing a New Release

  • Update CHANGELOG.md with details of changes and new version
  • Run bin/build.py. This will extract version from CHANGELOG.md, bump version in pyproject.toml and generate a build for publishing
  • Tag with new version and update the version branch:
    • ver=$( poetry version --short ) && echo "Version: $ver"
    • git tag v/frontend/$ver
    • git push --tags
  • To publish to test.pypi.org
    • poetry publish --repository testpypi
  • To publish to pypi.org
    • poetry publish

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

alliance_platform_frontend-0.0.17.tar.gz (86.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file alliance_platform_frontend-0.0.17.tar.gz.

File metadata

  • Download URL: alliance_platform_frontend-0.0.17.tar.gz
  • Upload date:
  • Size: 86.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.19.3 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for alliance_platform_frontend-0.0.17.tar.gz
Algorithm Hash digest
SHA256 4017912ca56d2d9a9d80fb3e4da3f15e1ffbd129898744e3962de977ac948eff
MD5 7d08d349967a712c37f824aa85d18a2d
BLAKE2b-256 1f0e298b78d672e0cf123347a668061ea4801a6eef6ad810908e7bc5b0e97b5b

See more details on using hashes here.

File details

Details for the file alliance_platform_frontend-0.0.17-py3-none-any.whl.

File metadata

File hashes

Hashes for alliance_platform_frontend-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 f1a90adc7d3183c66f6c0e35a6b243792943c99d18b5f7fdabba45ba4650856c
MD5 10519131fd23e01f4e2b9b4b0d7799d0
BLAKE2b-256 02f7eabf8fb1016cb3046b459b9fcdda861f83dc424bf0a75a66c7bba6458ec0

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