Friday, December 26, 2014

Re: Template Not Applying - Django Polls Tutorial (Newbie Question)

Hi,

This one comes up a lot. It's confusing because {% block title %} is the _html_ <title>, the title of the browser tab.

You want to change {% block branding %}.

Collin

On Tuesday, December 23, 2014 5:18:49 PM UTC-6, Ken Wayne wrote:
Hmmm, that is one of the directories I tried, C:\Python34\Scripts\mysite\templates\admin with the file base_site.html

On 12/23/2014 5:07 PM, Néstor wrote:
You might need to make for admin
mysite/templates/admin/base_site.html

for regular html files for the polls only
mysite/polls/templates/polls/index.html

That is how I got it to work.  Good luck!!!

:-)

On Tue, Dec 23, 2014 at 2:13 PM, Ken Wayne <ecom...@gmail.com> wrote:
Windows 8
Django 1.7.1
Python 3.4.2
Google Chrome Version 39.0.2171.95 m

Bottom of part 2 of the the tutorial https://docs.djangoproject.com/en/1.7/intro/tutorial02/ it indicates how to customize the admin template but when I follow the directions it doesn't show any change in my browser.  I've restarted the development server and refreshed my browser.

File Snip base_site.html:
{% block title %}{{ title }} | <h1 id="site-name"><a href="{% url 'admin:index' %}">Polls Administration</a></h1> {% endblock %}

File Snip settings.py:
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
TEMPLATE_DIRS = ['C:\Python34\Scripts\mysite\templates']

I tried the environment path, and hard coding the path.  Since the tutorial didn't indicate the BASE_DIR path I made a copy of the file in each of the following directories:
C:\Python34\Scripts\mysite\templates\admin
C:\Python34\Scripts\mysite\mysite\templates\admin
C:\Python34\Scripts\mysite\polls\templates\admin

Any thoughts on what I might be doing wrong?
--
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...@googlegroups.com.
To post to this group, send email to django...@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/0a7c4e30-ba26-418b-b217-72936c72975f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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...@googlegroups.com.
To post to this group, send email to django...@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/CAON-vCPcGEhk3%2B0wO4RXSnuQWqW5H6H4ZbiHoo1h5yRx36GbBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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/a1b37c58-aa89-4731-8c07-acf214e8721e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment