First time here? Check out the FAQ!
0

How to reference a new template file defined in a custom skin?

I created a new skin called myskin and set ASKBOT_EXTRA_SKINS_DIR accordingly. Overwriting default templates seems to work.

I want to create a custom home page, with a template called "home.html", located in this new skin, which inherits from "one_column_body.html" (defined in common).

However, in my custom app (installed along with askbot), when I tried to invoke render_to_response() on "home.html", I get this error: "TemplateDoesNotExist at /"

theactiveactor's avatar
167
theactiveactor
asked 2012-07-04 17:02:39 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

That's because creating a template does not automatically create an url or the function that would respond to the url.

If your page is static you could change configuration for url / in the askbot/urls.py and create a simple view that renders your template and returns a response with the rendered contents.

Evgeny's avatar
13.2k
Evgeny
answered 2012-07-04 17:09:05 -0600
edit flag offensive 0 remove flag delete link

Comments

I did that already, you misunderstood my question. Let me rephrase it this way- calling render_to_response() from a view fails to find template files that are located in a custom skin.

theactiveactor's avatar theactiveactor (2012-07-07 15:15:29 -0600) edit

render_to_response won't pick up a template for the skin, right now askbot uses it's own render_into_skin, but this is fixable - we will make use of the standard template loading API. We will also simplify the way templates are organized in the skin. I think we will also leave just default theme in askbot - to simplify the directory structure as much as possible.

Evgeny's avatar Evgeny (2012-07-07 15:23:28 -0600) edit

That is fine, thank you for clarifying. render_into_skin() looks like it's sufficient for my needs.

theactiveactor's avatar theactiveactor (2012-07-07 23:12:07 -0600) edit
add a comment see more comments