Styled Django templates for Girder-4 applications.
Project description
django-girder-style
django-girder-style is a Django library providing styled Django templates for Girder-4 applications.
Benefits
django-girder-style provides an extensible block-oriented base HTML template. This base template includes a pre-built Tailwind CSS (with some minor customizations) stylesheet, Remix Icon support, and the Nunito font.
Additionally, django-girder-style provides styled versions of all django-allauth view templates. This styling allows some limited branding customization as well.
Installation
Install django-girder-style:
pip install django-girder-style
Enable django-girder-style as an installed Django app:
# settings.py
INSTALLED_APPS = [
# Any project-local apps should come before "girder_style",
# so templates can be overridden as needed
'my_django_app.apps.MyDjangoAppConfig',
...,
'girder_style',
...,
# If "allauth" is installed, it must come after "girder_style"
'allauth',
'allauth.account',
'allauth.socialaccount',
]
Usage
Base Template
All project templates
should extend
girder_style/base.html
.
This provides the following blocks to inject content:
head_title
: The content of the<title>
tag.extra_head
: Additional HTML placed within the<head>
tag.body
: The entire HTML body content, including the<body>
tag itself.
For example, a template my_app/home.html
may contain:
{% extends 'girder_style/base.html' %}
{% block head_title %}My App{% endblock %}
{% block extra_head %}
<script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
{% endblock %}
{% block body %}
<body>
<div>Hello World.</div>
</body>
{% endblock %}
django-allauth Templates
When django-girder-style is properly installed with django-allauth, templates will automatically be overridden with styled alternatives.
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-girder-style-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3214c1314d0e706952323d311b0580ea01ff9270dd7009c66d8834ed2f0cdd0a |
|
MD5 | 36380fb5dd052a05ff3571da57cf308c |
|
BLAKE2b-256 | 002d39b43f8985f8a73700af892f5487eec822180d9c3d8fbcc8d7d51e9d5566 |
Hashes for django_girder_style-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b1111e9f5869d783a07c070075497351784520a51d4dec678283954671ae90 |
|
MD5 | 51b92bc327f330d4c630b474d5b44ca8 |
|
BLAKE2b-256 | 52ad92508af58363f642b180f207dfef543f68039091e9202c0482b38e2cfcb4 |