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.
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
HelloWorldclass andhello-world.htmltemplate and update based on theexampleproject
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 some_folder/django-unicornand follow install instructions above
Minify Javascript
npm installnpm run-script build
Bump version
npm run-script build- Move
django_unicorn/static/js/unicorn.min.jsto appropriate folder for new version poetry version major|minor|patchpoetry publish --build
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.1.1.tar.gz.
File metadata
- Download URL: django-unicorn-0.1.1.tar.gz
- Upload date:
- Size: 30.0 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 |
2d385ea718a28e6c9a230a6649b6b0a15ddd330f40c33c8faa5ffeb14b9903cd
|
|
| MD5 |
6a56c77e2481306347485dcadffe05b1
|
|
| BLAKE2b-256 |
b7c6719432948d34d29b104cf006f125551f3e597f8a657d33849e0d134db910
|
File details
Details for the file django_unicorn-0.1.1-py3-none-any.whl.
File metadata
- Download URL: django_unicorn-0.1.1-py3-none-any.whl
- Upload date:
- Size: 34.4 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 |
440734d0c06f1a4cfd190d204e40c3a575a706543d8230b4f8b4b733276fcda4
|
|
| MD5 |
4dd8086d8ead1a5f2a24937cb0df8871
|
|
| BLAKE2b-256 |
4983b7df5493ba58d397138226eb85f6e1a4f1fe7d2c6975a865cb77a6a8ee3f
|