Expose the Datasette request object to custom templates
Project description
datasette-template-request
Expose the Datasette request object to custom templates
Installation
Install this plugin in the same environment as Datasette.
$ datasette install datasette-template-request
Usage
Once this plugin is installed, Datasette custom templates can use {{ request }}
to access the current request object. For example, to access ?name=Cleo
in the query string a template could use this:
Name: {{ request.args.name }}
Development
To set up this plugin locally, first checkout the code. Then create a new virtual environment:
cd datasette-template-request
python3 -mvenv venv
source venv/bin/activate
Or if you are using pipenv
:
pipenv shell
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
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
Close
Hashes for datasette-template-request-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37e1ce795d635ca8c9df72ccd1abb8704b062bcf39f3d8f5aa5edb9e1b136f66 |
|
MD5 | de29b7262f524bdda5570a73cbad41bd |
|
BLAKE2b-256 | b86e6f35e338e6278c796c83eada47fd97c8c9b7cb3dced07029f091c82aff94 |
Close
Hashes for datasette_template_request-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edce93be789ea7bbf37d97a3121cb69048dd9f3bfff341226043f02ad9a9a9d3 |
|
MD5 | 80ced62425378b24a0ee1778118740ab |
|
BLAKE2b-256 | db72b685ec634172c79e5ab4d04ee4f1369f47af40932aa3c74402708cd272e5 |