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
Metadata
Release files for datasette-template-request 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datasette-template-request-0.1.tar.gz | 2.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datasette_template_request-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.7 kB
Release files / datasette-template-request-0.1.tar.gz
| Download URL | datasette-template-request-0.1.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37e1ce795d635ca8c9df72ccd1abb8704b062bcf39f3d8f5aa5edb9e1b136f66
|
|
BLAKE2b-256 checksum How to use checksums |
b86e6f35e338e6278c796c83eada47fd97c8c9b7cb3dced07029f091c82aff94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|
Release files / datasette_template_request-0.1-py3-none-any.whl
| Download URL | datasette_template_request-0.1-py3-none-any.whl |
|---|---|
| Size | 2.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
edce93be789ea7bbf37d97a3121cb69048dd9f3bfff341226043f02ad9a9a9d3
|
|
BLAKE2b-256 checksum How to use checksums |
db72b685ec634172c79e5ab4d04ee4f1369f47af40932aa3c74402708cd272e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
|