Ask Your Question
0

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

asked 2012-07-04 17:02:39 -0600

theactiveactor gravatar image

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 /"

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-07-04 17:09:05 -0600

Evgeny gravatar image

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.

edit flag offensive delete link more

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 gravatar imagetheactiveactor ( 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 gravatar imageEvgeny ( 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 gravatar imagetheactiveactor ( 2012-07-07 23:12:07 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-07-04 17:02:39 -0600

Seen: 82 times

Last updated: Jul 04 '12