variable that Django needs. You could do that manually, but the
recommended way is to use the shell provided by Django.
Just use 'python manage.py shell' instead of IDLE. The missing
Variables will be set. That should do the trick.
On 28 Aug., 15:17, Kheyreddine Hadri <h.kheyredd...@gmail.com> wrote:
> when I use Python shell to work with Django I allways get an error
> when I use "def" or "for" or "while" :
> File "<console>", line 2
> pass
> ^
> IndentationError: expected an indented block
> and when I create a template on the IDLE I get this message:
>
> Traceback (most recent call last):
> File "C:\Python27\Scripts\project\template.py", line 16, in <module>
> t = Template(values)
> File "C:\Python27\lib\site-packages\django\template\base.py", line
> 106, 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
> 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
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment