On 11/05/2010 4:04pm, Mike Dewhirst wrote:
On 11/05/2010 3:42pm, Old Davy wrote:
On 05/10/2010 08:18 PM, Shawn Milochik wrote:
Exactly what directory is your copied template in? It's most likely
not in the right place.
Ensure that you have a template dir that your settings knows about,
and that template dir has a subdirectory called 'admin' where that
file is placed.
Shawn
That would make the most sense, and that would be my working assumption.
But I can't for the life of me see where the disconnect is.
this is the string that's in the TEMPLATE_DIRS section of my settings.py
file:
"/home/llanitedave/Development/djangoProjects/django1.1Training/mysite/admin/base_site.html"
You want a directory rather than a file (base_site.html) for TEMPLATE_DIRS
This is mine ...
# if templates are not found here look in app_name/templates
TEMPLATE_DIRS = (os.path.join(PROJECT_ROOT,
'templates').replace('\\','/'),)
This puts my templates directory in the same dir as my settings.py file.
Inside it I have a sub-dir for each application for which I want
templates. For example, in one of them I have ...
../templates/admin/base_site.html
Which contains ...
{% extends "base.html" %}
{% load i18n %}
{% block title %}{{ title }} | {% trans 'Mysite site admin' %}{%
endblock %}
{% block branding %}
<h1 id="site-name">{% trans 'Mysite administration' %}</h1>
{% endblock %}
... and which turns Django Admin into Mysite admin. However, the
"base.html" which it extends is actually in ../templates
If I wanted Mysite base_site.html to extend the real Django base.html I
would have to put ... {% extends "admin/base.html" %}
Just realised I could have confused you a little.
Sooooo
You can extend anything you want to specifically nominate but if you
just nominate a bare filename the way I do with base.html in ...
mysite/templates/admin/base_site.html
... base.html has to exist in TEMPLATE_DIRS (mysite/templates)
If you want to extend "admin/base.html" from the above base_site.html
then Django looks first in ...
TEMPLATES_DIR/admin
... and if it doesn't find it then it looks in
site-packages/django/contrib/admin/templates/admin
Mike
HTH
Mike
That's exactly the path that my directories show, including my
idiosyncratic upper case letters.
I did find the file that my poll app is referencing. Turns out it was in
my '/usr/local/lib/python2.6... path instead of my home directory. So
when I modified THAT file, it used my changes. However, that still
doesn't help, as it's not using the file that I copied to my local
directory.
I suppose I can play with a few more directories and see what happens...
--
Climate Pty Ltd
PO Box 308
Mount Eliza
Vic 3930
Australia +61
T: 03 9787 6598
M: 0411 704 143
Mike Dewhirst
Certified Scrum Master
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.