Saturday, September 5, 2015

Re: customize project templates

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

2015-09-06 9:46 GMT+07:00 Terry Chia <terrychia1@gmail.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.



--
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/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: lamhaison@gmail.com

--
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/CAN90_rnjHTqMFU-WPhLEHLwm83ERbQvfy%2BhK3x30kQDovcNr4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment