Spectre CSS for Django
Project description
django-spectre-css
This Module uses spectre.css (https://picturepan2.github.io/spectre/) to style a Django application.
Installation
Install:
pip install django-spectre-css
To use include static/css/lib/\*.css
in your base templates css files or in your CSS pipeline
add it to your installed apps:
INSTALLED_APPS = [
'...',
'django-spectre-css',
]
Examples:
This module defines the following tags to make displaying Forms easier.
The help_text from models is mrked as save in the template and therfore it is possible to have html e.g. links in the help_text.
-
render a field user of the form 'form':
{% extends base.html %} {% load spectre_css %}
[...] {% render_form_field form.user %}
-
render the whole form:
{% extends base.html %} {% load spectre_css %}
{% render_form form %}
render_form_field
takes the following keyword arguments:
switch=True|False
for checkboxes, ifTrue
renders the checkbox as switchadd_choices=[(value,text),...]
to add the choices of an select to the selectreplace_choices=[(value,text),...]
to set the choices of an select manuallyempty_option=value
to generate an empty option if None is selected with the textvalue
(only select widgets)value=value
overwrites the initial value of the field (not Checkbox and Select) withvalue
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
Hashes for django-spectre-css-0.1.dev2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c1a521549ff9350588a9b37e15cb1c0df3b9584878e6f385df8d00d2dec96e9 |
|
MD5 | 25b5dfd46c2a968a87db178f5340e34b |
|
BLAKE2b-256 | 831633a1d004f075b9a28cf58195b2d295bbcfea5153b33268aaf9dba077860f |
Hashes for django_spectre_css-0.1.dev2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb2469b98a8f03fb6afd573a6d3b7b8e304df80fbb7aee1a3c29833ba83a3e76 |
|
MD5 | 2c136b7e3c078aaacb6391ffcbae344a |
|
BLAKE2b-256 | 21448e4d19e1a8d98ae3f08b78a448af51b4579328982fadc3b26f1be34aee3a |