Hi Tim,
-- If you are using TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')], template directory should be under mysite (same level as manage.py).
Of course you can choose a different path. If you look into settings.py you will be able to figure out that BASE_DIR is the topmost level of the project.
Hope it helps,
Cheers,
Ankur
On Thursday, January 16, 2014 9:44:02 AM UTC+5:30, Tim DiSabatino wrote:
Manu,
This is the directory structure I have. I have pretty much tried it in all levels of the hierarchy with no success. In the tutorial for Django v1.5, it had you name a specific location in the filesystem where the base_site.html was located. In the new 1.6.1 tutorial, there is no mention of location and it seems to imply that Django will search the directory hierarchy to find the file in question.
Open your settings file (mysite/settings.py, remember) and add a TEMPLATE_DIRS setting:
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
TEMPLATE_DIRS is an iterable of filesystem directories to check when loading Django templates; it's a search path.
Anyway, here's my directory structure...many thanks for your help.
mysite
db.sqllite3
manage.py
mysite (directory)
__init__.py
db.sqlite3
settings.py
urls.py
wsgi.py
polls (directory)
__init__.py
admin.py
models.py
tests.py
views.py
templates (directory)
admin (directory)
base_site.html // This is the file in question not being read to alter the admin
// header names.
On Wednesday, January 15, 2014 10:28:38 AM UTC-8, Manu wrote:Can you post your directory structure here? The problem should be there, most probably.
On Wednesday, 15 January 2014 11:37:51 UTC+5:30, Tim DiSabatino wrote:Hello,
I am just going through the Django Tutorial and am in Writing your first Django app, part 2. In the section called "Customize the admin look and feel", I have created a templates directory, an admin directory inside of that, and copied the base_site.html file into the admin directory. I have also added the line below to the settings.py file as instructed:
TEMPLATE_DIRS = [os.path.join(BASE_DIR,'templates')]
However, when I change the <h1> in the base_site.html file, nothing happens. I have tried moving the templates directory around several times and still no change the admin <h1> text. It appears that others have had problems with this part of the tutorial in the past for previous versions of Django but the solutions I have tried don't seem to work with Django v 1.6.1. This part of the tutorial has changed even since Django 1.5. Can anyone help and tell me what I'm doing incorrectly? Is is some kind of absolute/relative path issue? Thanks so much for your help.
-Tim
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d1fa297d-4109-4f4d-8cd5-f27e5e61cecd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment