Flask-Pure is an extension to Flask that helps integrate Pure.css to your Flask application.
Quick Start
Installation
pip install Flask-Pure
Configuration
from flask import Flask, render_template from flask_pure import Pure app = Flask(__name__) app.config['PURECSS_RESPONSIVE_GRIDS'] = True app.config['PURECSS_USE_CDN'] = True app.config['PURECSS_USE_MINIFIED'] = True Pure(app) @app.route('/') def hello(): return render_template('hello.html') if __name__ == '__main__': app.run(debug=True)
In
templates/hello.html:
{% extends "pure/layout.html" %} {% block title %}Hello world from flask-pure{% endblock %} {% block nav %} <div class="pure-menu pure-menu-horizontal"> <!-- ... --> </div> {% endblock %} {% block content %} <h1>Hello world</h1> {% endblock %}
Profit!
How It Works
Once registered, this extension provides a template variable called
pure, it has a property named css that will be rendered
as HTML <link> tag to the Pure.css stylesheets either from free CDN or
be served from a bundled blueprint, also called pure.
A {{ pure.css }} inside <head> tag is all you need.
A bare bone HTML5 template is also available as pure/layout.html.
Please check out the example in code repository and documentation for details.
License
BSD New, see LICENSE for details.
Links
Metadata
Release files for Flask-Pure 0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Flask-Pure-0.5.tar.gz | 21.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Flask_Pure-0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.7 kB
Release files / Flask-Pure-0.5.tar.gz
| Download URL | Flask-Pure-0.5.tar.gz |
|---|---|
| Size | 21.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
98fe1c268e6f2d3850652fe28ba61616a42a22bd91b73e71a1a017d153cab8b4
|
|
BLAKE2b-256 checksum How to use checksums |
5e367976688e0dcfa24b57461a791fa9b59db50b4c5a69994f640c883a3727a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Flask_Pure-0.5-py3-none-any.whl
| Download URL | Flask_Pure-0.5-py3-none-any.whl |
|---|---|
| Size | 21.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b84f3dd529d67aa81e5d8c089233748e6c6c812349fcad728ca9da13f428b6dd
|
|
BLAKE2b-256 checksum How to use checksums |
7a19e6c88f57aea8362924c7d153364e69cb5e855e0fcb3a39c6134c86f9398c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |