djc / askama

Type-safe, compiled Jinja-like templates for Rust
Apache License 2.0
3.35k stars 215 forks source link

HELP: about askama_axum::Template #1025

Closed SnailFighter closed 4 months ago

SnailFighter commented 4 months ago

Hello everyone, I am trying the axum and the askama to deveop a web app frist, and I code as the example, but it still reports error. What should i do? Here is the cargo code : `[package] name = "axum_hello" version = "0.1.0" edition = "2021"

[dependencies] axum="0.7.5" tokio={version="1.37.0",features=["macros","rt-multi-thread"]} askama_axum="0.4.0"`

Rust Code:

`use askama_axum::Template;

[derive(Template)]

[template(path="me.html")]

struct Person<'a> { name: &'a str, }`

企业微信截图_17144746598923

djc commented 4 months ago

Unfortunately the published book is based on the main branch, and the integrations on main work differently from released versions. So you'll need to add askama directly in your Cargo.toml.

GuillaumeGomez commented 4 months ago

We should really handle that differently, it's really problematic that only the main branch book version is published.