Skip to main content

A magical fullstack framework for Django.

Project description

django-unicorn

The magical fullstack framework for Django. ✨

django-unicorn provides a way to use backend Django code and regular Django templates to create interactive experiences without investing in a separate frontend framework.

Why?

Building server-side sites in Django with the ORM and template engine is so pleasant, but once you need more interactivity on the frontend, there is a lot more ambiguity. Should you build out an entire API in Django REST framework? Should you use React or Vue.js (or some) other frontend framework?

It seems like there should be an easier way to create interactive experiences.

A note on beta software

django-unicorn is beta software and the API will likely change on the way to 1.0. All efforts will be made to include an easy upgrade path. 1.0.0 will signify that the API won't change until the next major release.

Site

https://www.django-unicorn.com

Demo

https://github.com/adamghill/django-unicorn/blob/master/demo.mp4

Install

  1. git clone git@github.com:adamghill/django-unicorn.git
  2. pip install -e ../django-unicorn
  3. Add django-unicorn and unicorn to INSTALL_APPS in your Django settings file
  4. Add path("unicorn/", include("django_unicorn.urls")), into your project's urlpatterns in urls.py
  5. Add {% load unicorn %} to the top of your base template file
  6. Add {% unicorn_styles %} and {% unicorn_scripts %} into your base HTML file

How to create a component

  1. python manage.py startunicorn hello-world
  2. Add {% unicorn 'hello-world' %} into the template you want to load the new hello-world component
  3. Take a look at hello_world class and hello-world.html template

Current functionality

  • unicorn_styles, unicorn_scripts, unicorn template tags
  • Base component class
  • Handles text input, checkbox, select options, select multiple options

Developing

  1. git clone git@github.com:adamghill/django-unicorn.git
  2. poetry install
  3. poetry run example/manage.py migrate
  4. poetry run example/manage.py runserver 0:8000
  5. Go to localhost:8000 in your browser
  6. To install in another project pip install -e ../django-unicorn

Minify Javascript

  1. npm install
  2. npm run-script build

Bump version

  1. npm run-script build
  2. poetry version major|minor|patch
  3. Commit/push version bump
  4. poetry publish --build -r pypi -u __token__

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

django-unicorn-0.2.1.tar.gz (27.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_unicorn-0.2.1-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file django-unicorn-0.2.1.tar.gz.

File metadata

  • Download URL: django-unicorn-0.2.1.tar.gz
  • Upload date:
  • Size: 27.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.6 Darwin/19.6.0

File hashes

Hashes for django-unicorn-0.2.1.tar.gz
Algorithm Hash digest
SHA256 ae5e2afcccb5c2288e38a5ea9ed11fdd35ce16cbc925439ea4c27911cede49e9
MD5 b9822362bcaf7a81a74eae794e4ffca7
BLAKE2b-256 612789e262afe8639500c1d9fda56e2cfe280757b98f9a817e454beddde13ff7

See more details on using hashes here.

File details

Details for the file django_unicorn-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: django_unicorn-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.6 Darwin/19.6.0

File hashes

Hashes for django_unicorn-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e96d50caae1951ad7bee5329160a113fe3951b9451c7427ba7e6fb3690d1e724
MD5 8d85f4552547ebdc473b13930ff00b91
BLAKE2b-256 19ee0750718ee5b781704abe97f465c9cc69bf7ecbe45afeb881c886153ae395

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page