Simple jinja2 support for Falcon framework.
pip install falcon-jinja2
import falcon
from falcon_jinja2 import FalconTemplate
# NOTE: if you want to change name of folder where your HTML files are defined
# Add `path` argument to the FalconTemplate class
# Example:
# falcon_template = FalconTemplate(path='path_to_your_folder')
falcon_template = FalconTemplate()
class FirstResource:
@falcon_template.render('index.html')
def on_get(self, req, resp):
resp.context = {'framework': 'Falcon'}
app = falcon.API()
app.add_route('/first', FirstResource())
- Add
url_for
support - Add
flash
messages support
- Fork the repository.
- Create a branch with feature/fix/cleanup, and create an Pull request.
- Have fun :)