Turbolinks for Flask.
Project description
Turbolinks for Flask.
Turbolinks
Turbolinks makes following links in your web application faster. For more information, visit the original rails repo: turbolinks.js.
Installation
To install Flask-Turbolinks, simply:
$ pip install Flask-Turbolinks
Or alternatively if you don’t have pip:
$ easy_install Flask-Turbolinks
Usage
To enable turbolinks, you need to put turbolinks.js in the <head> of your html templates.
The backend flask app should be wrapped with turbolinks:
from flask import Flask from flask_turbolinks import turbolinks app = Flask(__name__) # you app should has a secret key for session app.secret_key = 'secret' turbolinks(app)
And everything works now, no more configuration.
Note
You can install the javascript code with component:
$ component install lepture/flask-turbolinks
You can also grab the code from turbolinks.js on GitHub. It is written in CoffeeScript, you can compile it with:
coffee -c turbolinks.js.coffee
Demo
There is a demo in the example directory, start a server and open the url with Chrome. View the requests with developer tools of Chrome.
Credits
Thanks for rails, thanks for the help of Rei.
Changelog
We keep the changelog on GitHub releases.
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
File details
Details for the file Flask-Turbolinks-0.1.3.tar.gz
.
File metadata
- Download URL: Flask-Turbolinks-0.1.3.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8240bc8ce4219d89e12fc866414da54ba34239a692a4a495dd7b7f4bb4c84fe3 |
|
MD5 | 0ab962bd65202c7cc3ffb5cb3b40b47a |
|
BLAKE2b-256 | 5d3c4df51c26c22a0f133049317209551d0713bc75ed03d43c5b81c30881f68a |