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.dev1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 700f2829bedb679cc527b5ba7b48d40bf07477e38329614f7d304e8c9f11fa9c |
|
MD5 | ff24e67c659fbaa2561ef49f8ce714f7 |
|
BLAKE2b-256 | fb4e3e31f10ba385409a61740ad26f53a1d11c869fe3ef8e5671eaab96ea39fd |
Hashes for django_spectre_css-0.1.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d16d16006900c864f224e7ad1792bf9fb3f151bcb712c497423d18af48ad9ea |
|
MD5 | 09644aaa50a4a75344087ceda9d7c7cc |
|
BLAKE2b-256 | b895062b7f5fe968054fea7dcdecde63e3e86428a475ecc31849c7892fb03a1d |