Learning Django - Error going through Chapt 4 on Templates at DjangoBook.com - Probably real simple

4 views
Skip to first unread message

bayousoft

unread,
Dec 18, 2009, 2:50:17 PM12/18/09
to Django users
I am brand new to Django and I'm trying to get up to speed ASAP. I
really like it so far. I'm getting an error trying to create a
template in the shell.

>>> from django import template
>>> t = template.Template('My name is {{ name }}.')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.6/django/template/__init__.py",
line 166, in __init__
if settings.TEMPLATE_DEBUG and origin is None:
File "/usr/lib/pymodules/python2.6/django/utils/functional.py", line
269, in __getattr__
self._setup()
File "/usr/lib/pymodules/python2.6/django/conf/__init__.py", line
38, 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.

I am using Ubuntu (Karmic Koala) and I installed from the Package
Manager Version 1.1.1. I'm guessing I have some sort of a path
problem.

Can anyone give me a quick fix/explanation? I'd rather not skip this
issue because I imagine it will come back to bite me later.

bayousoft

unread,
Dec 18, 2009, 3:03:33 PM12/18/09
to Django users
Looking in Synaptic I'm kinda wondering if I need to install python-
jinja2 ?

bayousoft

unread,
Dec 18, 2009, 3:38:23 PM12/18/09
to Django users
Sorry guys. the explanation is in the next paragraph. Please
disregard.

On Dec 18, 1:50 pm, bayousoft <bayous...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages