0

How to override or replace admin templates for own app?

Hi,

I'm trying to override or replace the admin templates, but I can't find how to do this.

I have created a /templates/admin/my_app/my_model directory ( as Django docs says at https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates (Overriding admin templates) ), which I put it on my askbot directory and I added it to ASKBOT_EXTRA_SKINS_DIR ( http://askbot.org/en/question/207/ (reference1) and http://askbot.org/en/question/7499/askbot_extra_skins_dir-settings-stalls-model-validation/?answer=7504#post-id-7504 (reference2) ). This directory contains a modified copy of change_form.html provided by Django.

I don't know what is wrong, but it still showing the default template.

Can anyone help me? Thanks!

Fernando's avatar
1
Fernando
asked 2013-04-08 13:10:51 -0600, updated 2013-04-08 13:14:12 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Hello again,

I was confused because I thought that TEMPLATE_DIRS does not work with Askbot like I had read at http://askbot.org/en/question/207/. Finally I have used the default setting from Django docs for override the admin templates:

  • Create a directory, e.g. .../template/admin/my_app/my_model and include it (only '.../templates' --> the root path of templates dir) in TEMPLATE_DIRS from settings.py.

I have left ASKBOT_TEMPLATE_EXTRA_DIR as comment.

Thanks!!

Fernando's avatar
1
Fernando
answered 2013-04-08 14:49:08 -0600, updated 2013-04-08 14:53:38 -0600
edit flag offensive 0 remove flag delete link

Comments

The regular mechanism using TEMPLATE_DIRS and TEPMLATE_LOADERS should work, but I have not tested on those templates.

Evgeny's avatar Evgeny (2013-04-08 15:02:31 -0600) edit

Well, at the moment that configuration works. I'll comment here if I have more problems with this.

Fernando's avatar Fernando (2013-04-08 15:10:24 -0600) edit
add a comment see more comments