/websauna.j2secret

Websauna Jinja2 extension that adds a tag to generate secrets.

Primary LanguagePython

Websauna Jinja2 Extension

This is a Jinja2 extension required by Cookiecutter Websauna templates.

ci cov  
Supported Python versions Latest Version License

Using the same virtualenv where cookiecutter is installed install this extension executing pip install:

pip install websauna.j2secret

Extend the Cookiecutter environment with this custom Jinja2 extensions, that adds a tag named secret , specifing the websauna.j2secret extension in cookiecutter.json as follows:

{
    "authentication_random": "{% secret() %}",
    "authomatic_random": "{% secret() %}",
    "session_random": "{% secret() %}",
    "_extensions": ["websauna.j2secret.SecretExtension"]
}

Read more about Template Extensions for Cookiecutter.

Install test and dev dependencies (run in the folder with setup.py):

pip install -e ".[test]"

Run test suite using py.test running:

py.test

Please see https://websauna.org/