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 atpoetry-repository-testpypi
- On macs this will be stored in the
- Main pypi repository
- Generate an account API token at https://pypi.org/manage/account/token/
poetry config pypi-token.pypi ${TOKEN}
- On macs this will be stored in the
login
keychain atpoetry-repository-pypi
- On macs this will be stored in the
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 inpyproject.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
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
Hashes for alliance_platform_frontend-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f95f84dd0e5b1e14c8bb7b282908b2958cf22eaaa99d5f56f13e859d5a6e0395 |
|
MD5 | 35038e9362ef9e6810e060149e4006d2 |
|
BLAKE2b-256 | 1b2d4eac7c5be43e823d717b1046a0f5ebb071fb17f0ff6b50f021cb80adb262 |
Hashes for alliance_platform_frontend-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 072ec9ad8cd4925c1a877656427c5ace5a5b8aefae0e1f360aadeb18b85430af |
|
MD5 | 429e137d3d872b46f6ee8a6019e3b355 |
|
BLAKE2b-256 | dfcb55e2d98294697bdf5ed9aa4b9e9c6c7b6b9f360b82b3f91d998937ef61da |