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
git clone git@github.com:adamghill/django-unicorn.gitpip install -e ../django-unicorn- Add
django-unicornandunicorntoINSTALL_APPSin your Django settings file - Add
path("unicorn/", include("django_unicorn.urls")),into your project'surlpatternsinurls.py - Add
{% load unicorn %}to the top of your base template file - Add
{% unicorn_styles %}and{% unicorn_scripts %}into your base HTML file
How to create a component
python manage.py startunicorn hello-world- Add
{% unicorn 'hello-world' %}into the template you want to load the newhello-worldcomponent - Take a look at
hello_worldclass andhello-world.htmltemplate
Current functionality
unicorn_styles,unicorn_scripts,unicorntemplate tags- Base
componentclass - Handles text input, checkbox, select options, select multiple options
Developing
git clone git@github.com:adamghill/django-unicorn.gitpoetry installpoetry run example/manage.py migratepoetry run example/manage.py runserver 0:8000- Go to
localhost:8000in your browser - To install in another project
pip install -e ../django-unicorn
Minify Javascript
npm installnpm run-script build
Bump version
npm run-script buildpoetry version major|minor|patch- Commit/push version bump
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-unicorn-0.2.0.tar.gz.
File metadata
- Download URL: django-unicorn-0.2.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b69c85ffd0ec91e84b70754c57b6e0272d43b42ad7a003d6e7f78a2248eb83b
|
|
| MD5 |
84bad2e3a2eb03c1dbbb53d1300c8983
|
|
| BLAKE2b-256 |
d62d45f1c518f66232e5dfe2c30494b8093f14f66efd520e641417ef6e0e03a5
|
File details
Details for the file django_unicorn-0.2.0-py3-none-any.whl.
File metadata
- Download URL: django_unicorn-0.2.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98d56bfe647da895d3d648a837a0172afa87330ff0909c9127d6b31ffc222d1d
|
|
| MD5 |
e38e50e4a488129a828b591b01c4992d
|
|
| BLAKE2b-256 |
793a49008f8ff8c4826aeca015926ee32b2390148156a4d6993cbcff2d813b2d
|