E
E
einbleiben2014-06-07 00:42:25
Django
einbleiben, 2014-06-07 00:42:25

Can't get the hang of Django's templating system. I ask for help

Dear colleagues. I began to actively study the Django framework and immediately ran into a few stupid things. I wanted to ask you about one of them. Python v 2.7, Django v. 1.6
I am writing:

from django.template import Template
t=Template("My name is {{Name}}")
print t

The interpreter swears at this banal thing in the second line, and sends me to the jungle of dzhang files. Put your head on my shoulders, please.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Soshnikov, 2014-06-07
@einbleiben

It looks like (according to the log) that you are running the code from the Python console, and not from the Jang one. Accordingly, the entire dzhangovskaya machinery is not initialized and your code tries to work in a bare environment.
Try
$ python ./manage.py shell

B
Boxxy, 2014-06-07
@Boxxy

How about a log?

O
overmes, 2014-06-07
@overmes

this code works for me,
it didn't run if I run it outside the project

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question