Tuesday, January 17, 2006

Changing the django template

Everything went on smoothly. Get to play with the functionality within admin form, modify it, add some choices, etc, not a problem at all.

So as I approaching the end of tutorial 2, got stuck at another exercise to customize the admin look. What I suppose to do is just copy the base_site.html file from "django/contrib/admin/templates/admin/"

And paste it under "myproject/mytemplates/admin". But as I change the template directory in settings.py to show the current reference template, I got confused.
TEMPLATE_DIRS = (
"/home/myproject/mytemplates",
)

It said "home", but the problem is which point should be considered home, the django load point? or Python load point? or "myproject"? It fact, I have tried all three, but it still didn't work. I will keep on the trial and error process, pretty sure there are no major issues here, must be just some tiny thing need to be fine tune.

1 comment:

Wilson Miner said...

"/home/" in the example refers to the common unix pattern of putting user directories under "/home/" (as in "/home/cavlyn/"

Your templates can go anywhere you want, and the TEMPLATE_DIRS setting just needs to include the filesystem path to whatever directory you choose.