No DjangoTemplates backend is configured一直报错这个,求助大神 40C
from django.template import Template, Context
from django.conf import settings
settings.configure()
t = Template('My name is {{ name }}.')

运行最后一句的时候就报错了,显示是这样的

Traceback (most recent call last):

  File "<ipython-input-8-72e1b7b0eeae>", line 1, in <module>
    t = template.Template('My name is {{ name }}.')

  File "C:\Users\Administrator\Anaconda2\lib\site-packages\django-1.11.22-py2.7.egg\django\template\base.py", line 184, in __init__
    engine = Engine.get_default()

  File "C:\Users\Administrator\Anaconda2\lib\site-packages\django-1.11.22-py2.7.egg\django\utils\lru_cache.py", line 124, in wrapper
    result = user_function(*args, **kwds)

  File "C:\Users\Administrator\Anaconda2\lib\site-packages\django-1.11.22-py2.7.egg\django\template\engine.py", line 83, in get_default
    "No DjangoTemplates backend is configured.")

ImproperlyConfigured: No DjangoTemplates backend is configured.

然后网上找了很久一直找不到解决方法,有大神帮帮忙吗

1个回答

weixin_39599440
URPG 我的确实在project下面启动Python的啊,但还是不行
8 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问