Форум сайта python.su
Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import django
>>> django.VERSION
(1, 2, 1, 'final', 0)
>>> from django.temlate import Template
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
from django.temlate import Template
ImportError: No module named temlate
>>> from django import template
>>> t = template.Template('My name is {{ name }}.')
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
t = template.Template('My name is {{ name }}.')
File "C:\Python27\lib\site-packages\django\template\__init__.py", line 156, in __init__
if settings.TEMPLATE_DEBUG and origin is None:
File "C:\Python27\lib\site-packages\django\utils\functional.py", line 276, in __getattr__
self._setup()
File "C:\Python27\lib\site-packages\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.
>>>
Офлайн
ДаниярУчите английский, там ничего про “не найден модуль” нет, питон не может найти настройки необходимые Джанге.
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined.
Офлайн