Skip to main content

Vanilla Framework frontend for Django

Project description

Django Vanillaframework

CI

Vanilla Framework frontend for Django

Requirements

Python 3.6 or newer, Django 3.2 or newer

Install

Using pip:

pip install django-vanillaframework

Setup

Add 'vanillaframework' to the INSTALLED_APPS list in your project settings

INSTALLED_APPS = [
    ...,
    'vanillaframework'
]

At this point, you can use Vanilla Framework in your Django templates, and the css will be pulled from assets.ubuntu.com

If you would like to use a local copy of the css file, run the install management command:

python3 manage.py vanillaframework -i --css

The vanillaframework_css tag will grab the local file from now on until it is deleted.

If you would like to customize Vanilla Framework settings, you can instead install the source sass files. Make sure npm is installed on your system before you begin.

Run the installer without the --css argument:

python3 manage.py vanillaframework -i

This will install the npm vanilla-framework package to the static folder alongside the file vanillaframework.scss. Use this file to customize the library.

Note: If you are using the sass version of Vanilla Framework, you will have to install django-compressor and a sass compiler such as django-libsass then update your settings file accordingly:

INSTALLED_APPS = [
    ...,
    'django.contrib.staticfiles',
    'vanillaframework',
    'compressor'
]

STATICFILES_FINDERS = (
    ...,
    'compressor.finders.CompressorFinder'
)

COMPRESS_PRECOMPILERS = (
    ('text/x-scss', 'django_libsass.SassCompiler'),
)

Usage

Once django-vanillaframework is set up, you can use it by including the relevant tags in a Django template.

For the css version, use vanillaframework_css:

{% load vanillaframework_tags %}

<html>
    <head>
        {% vanillaframework_css %}
    </head>
</html>

And for the sass version, use vanillaframework_sass:

{% load vanillaframework_tags %}

<html>
    <head>
        {% vanillaframework_sass %}
    </head>
</html>

Vanilla Framework can now be used in the same way it would be with a nodejs project. For information on this syntax, see the Vanilla Framework website.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-vanillaframework-1.0.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

django_vanillaframework-1.0.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file django-vanillaframework-1.0.1.tar.gz.

File metadata

  • Download URL: django-vanillaframework-1.0.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for django-vanillaframework-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ff56154e7a032f3de9a844c02b6c7f53506d8f920a32ac9408b522aafcbc61e2
MD5 e0fcf4e613229ef523929668ac282e03
BLAKE2b-256 3352a2578734cc23c1950703c4dc971bba6f36bf958bcdb6d4027ef8a2c26742

See more details on using hashes here.

File details

Details for the file django_vanillaframework-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_vanillaframework-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3438737ff84513b5f3e4db61bcfdfbe7a88d7479dae378fa474199ec7dff1133
MD5 f1292461b7bbe5abe68724658f1821f6
BLAKE2b-256 4bdff60a49a56d7f4785909cd2903df13f8e4897a56d283c1116c1d0e66ac076

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