Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom base_site.html not working in Django

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.

like image 575
Rogier Avatar asked Jul 22 '13 20:07

Rogier


1 Answers

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.

like image 171
Alasdair Avatar answered Nov 10 '22 05:11

Alasdair