Skip to content

Instantly share code, notes, and snippets.

@easyforgood
Created April 25, 2018 06:17
Show Gist options
  • Save easyforgood/18d8f1efd03482fda272bb6e6c99a847 to your computer and use it in GitHub Desktop.
Save easyforgood/18d8f1efd03482fda272bb6e6c99a847 to your computer and use it in GitHub Desktop.
Jinja 的路径导入
from jinja2 import Environment, FileSystemLoader
import os
env = Environment(loader=FileSystemLoader(
os.path.join(os.path.split(os.path.realpath(__file__))[0], ".")))
template = env.get_template("template.html")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment