Django need template dir to store your html ,so in the setting.py , you shuold set the template dir like this:
TEMPLATES = [and it is in root path of your project
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'template')]
,
'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',
],
},
},
]
2018-06-03 18:20 GMT+08:00 Umar Kambala <umarkambala@gmail.com>:
Please I have a problem, after successfully going through the django polls and having results, and now wans to run a tuturial on a web development, wen I runserver I gets errors. I don't really understand where the problem is. The problem is "NameError:name 'template' is not defined"
On Jun 1, 2018 4:22 PM, "Carlton Gibson" <carlton.gibson@gmail.com> wrote:----Details are available on the Django project weblog:
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 https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/7d59d8c3-cc5b .-4ecc-ac23-ce1fcb64d5ac%40goog legroups.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 https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ .CAPkbFbZ20jqjLVTZgJmg7busKczCp ZUj3xDjkYeR3haeWj%3DcYA% 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAH_QYw5%2Brq_Mc%2BLjT4KW8ZS4Q9HK%2B38JwqBkxRdapK6sNte6kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment