python使用django框架,调用template系统模板报错信息如下:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Tempalte'
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Tempalte'
解决方案1:
进入python模式后,导入环境变量
from django.conf import settings
settings.configure()
解决方案2:
在Linux环境模式下:django-admin.py startproject mysite
进入mysite目录,启动python交互式环境
python manage.py shell