Installation

Install django-unicorn the same as any other Python package (preferably into a virtual environment).

pip install django-unicorn
OR
poetry add django-unicorn

Next, install django-unicorn into the Django project.

  1. Add "django_unicorn", to the INSTALLED_APPS array in the Django settings file (normally settings.py)
  2. Add path("unicorn/", include("django_unicorn.urls")), into the project's urls.py
  3. Add {% load unicorn %} to the top of the Django HTML template
  4. Add {% unicorn_scripts %} into the Django HTML template

Then, create a component.