customize project templates

662 views
Skip to first unread message

Terry Chia

unread,
Sep 5, 2015, 11:03:15 PM9/5/15
to Django users, chi...@hotmail.com
Hello, 

I am doing "Writing your first Django app, part 2" provided by Django Documentation part 2 and is stuck at customising your project's template.

I am trying to customise the project template by copying the base_site.html from the Django admin template directory in the source code of Django into the project directory. 

I am facing with this warning. I have attached my file below. Can someone help? 

My path for base_site.html is at mysite/templates/admin/base_site.html

?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DIRS.



settings.py
base_site.html

Lâm Hải Sơn

unread,
Sep 6, 2015, 4:12:15 AM9/6/15
to django...@googlegroups.com, chi...@hotmail.com
Hello,
In django 1.8, setting template will be same bellow
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

Please put template directory of you to DIRS []
I thinks it will be 
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

Good lucky to you

--
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/95cdf763-6c4d-42c5-bc41-904007835c21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards,
Lâm Hải Sơn
Mobile: (84)(16)7548-9757
Skype: rungbiennui
Email: lamh...@gmail.com

Reply all
Reply to author
Forward
0 new messages