Error when using django.template

后端 未结 6 950
面向向阳花
面向向阳花 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:37

    I also had the same problem.

    The main point is that in the django book 2, this piece of code is not supposed for users to put into a Python IDLE started from your python.exe ( presumably in C:\Program Files\Python33 on Windows).

    Rather, it is just showing how the piece of code will look like. The solution is simply run 'cmd' and change the directory to your 'mysite', and run

    python manage.py shell

    which ensure that the 'mysite.settings.py' is used.

提交回复
热议问题