customize project templates

閲覧: 662 回
最初の未読メッセージにスキップ

Terry Chia

未読、
2015/09/05 23:03:152015/09/05
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

未読、
2015/09/06 4:12:152015/09/06
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

全員に返信
投稿者に返信
転送
新着メール 0 件