I tried to do this according the tutorial.
>>> from django import template
>>> t = template.Template('My name is {{ name }}.')
>>> c = template.Context({'name': 'Adrian'})
>>> print t.render(c)
My name is Adrian.
>>> c = template.Context({'name': 'Fred'})
>>> print t.render(c)
My name is Fred.
But I got this error
>>> t = template.Template('My name is {{ name }}.')
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
t = template.Template('My name is {{ name }}.')
File "C:\Python27\lib\site-packages\django\template\base.py", line
123, in __init__
if settings.TEMPLATE_DEBUG and origin is None:
File "C:\Python27\lib\site-packages\django\utils\functional.py",
line 184, in inner
self._setup()
File "C:\Python27\lib\site-packages\django\conf\__init__.py", line
40, in _setup
raise ImportError("Settings cannot be imported, because
environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
Any help
Cheers
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.