Skip to content

Packaging components #557

Answered by JuroOravec
mikko-ahonen asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @mikko-ahonen, coincidentally, I was doing that just yesterday and today! Have a look at https://github.com/JuroOravec/alpinui/tree/main/packages/alpinui-django.

How to:

  1. I defined the components inside the <my_app>/templates directory.
  2. All components are "single-file components" (SFC), meaning that I've inlined the HTML and CSS files, so there are no non-python dependencies.
  3. I imported the components files inside the ready() hook in apps.py, so the components are registered when user install the app with INSTALLED_APPS.
  4. I've built the distribution wheel using the same command as used in django-components:
    python -m build --sdist --wheel --outdir dist/ .
  5. I used twine to publish to Py…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by JuroOravec
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants