Jinja Materializecss theme capability
Project description
Fastapi Jinja materializecss theming system.
Example
# material_demo.py
import os
from fastapi import FastAPI, Request
import justengel_material
MY_DIR = os.path.dirname(__file__)
app = FastAPI()
material = justengel_material.MaterialTemplates(os.path.join(MY_DIR, 'templates'))
material.install_app(app, site_name='Material Demo', primary_color='purple', secondary_color='teal')
@app.get('/')
def index(request: Request):
ctx = {'request': request, 'base_url': request.base_url,
'title': 'index'
}
return material.TemplateResponse('material/index.html', ctx)
HTML Template in templates/material/index.html
{# templates/material/index.html #}
{% extends "justengel_material/base.html" %}
{% block contents %}
<h1>Hello World!</h1>
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<button class="btn">Button</button>
{% endblock contents %}
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
justengel_material-0.0.2.tar.gz
(255.9 kB
view hashes)
Built Distribution
Close
Hashes for justengel_material-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea4a26383ec9ed0fb83bff37a8979edbdc35aec6db6366ad271213bddde8d52e |
|
MD5 | 840ecc5edd29b6e7d2a58cf3d412778f |
|
BLAKE2b-256 | 309f0e59e01ac71e8c3c144cec4d6442620045eafb725adacf1fc9828ddb75e7 |