Error when using django.template

后端 未结 6 1058
面向向阳花
面向向阳花 2021-01-31 05:02

I\'m a beginner in django and I got a lot of errors when using template module from django. The following works from the python shell:

from django import templat         


        
6条回答
  •  眼角桃花
    2021-01-31 05:28

    If you want to use the template system without the django shell, you can do:

    from django.conf import settings
    settings.configure()
    

    and after this your code

    t = template.Template('My name is {{ name }}.')
    

提交回复
热议问题