Custom base_site.html not working in Django
Asked Answered
H

1

6

I am using Nitrous for playing with the Django framework. In tutorial 2 is shown how to change the base_site.html template. I've added in the TEMPLATE_DIRS = ( ) a new line:

'home/action/workspace/mysite/templates',

And in base_site.html I changed the site name title of Django Administration into Administration:

{% trans 'Administration' %}

But I still see no changes on the website. I've tried different TEMPLATE_DIRS like:

'~/workspace/mysite/templates',

'home/action/workspace/mysite/',

'home/action/workspace/mysite/templates/',

And restarting the server. But I am doing something wrong.

Haeres answered 22/7, 2013 at 20:30 Comment(0)
D
6

Note that this answer was written before the TEMPLATES setting was introduced in Django 1.8.

The tutorial says you should create an admin subdirectory inside your template directory, and put your template inside that.

Try with base_site.html in /home/action/workspace/mysite/templates/admin and with

TEMPLATE_DIRS = (
    '/home/action/workspace/mysite/templates',
)

Note the slash before /home/... and the trailing comma to make it a tuple.

Dharma answered 22/7, 2013 at 21:1 Comment(3)
Sorry that I didn't mentioned it, but I have copied the base_site.html to home/action/workspace/mysite/templates/admin and I also changed the TEMPLATE_DIRS into home/action/workspace/mysite/templates/admin...but without result.Haeres
Thanks, the slash before home is the solution! Note that the slash behind template is not necessary.Haeres
Glad that worked :) I've moved the comment to the answer, and removed the trailing slash.Dharma

© 2022 - 2024 — McMap. All rights reserved.