I get the same error about django settings Before, I know how to get it done 
under IDE ,but  for the thing under command line,cannot fix it. Under IDE , I 
just set the django module Settings to be project name plus settings.
Regards,    Bowen
发自我的 iPhone

在 2011-11-11,21:49,Ganesh Kumar <bugcy...@gmail.com> 写道:

> Hi ,
> 
> I have tried to load render_to_response module. it's through error. I
> have tried download and install the module
> https://github.com/jgorset/django-shortcuts
> installed sucessfully, But not load any one of  you help me guys.
> 
> 
> dhana013 ~ $ ipython
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
> Type "copyright", "credits" or "license" for more information.
> 
> IPython 0.10 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints more.
> 
> In [1]: from django.shortcuts import render_to_response
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call last)
> 
> /home/dhana013/<ipython console> in <module>()
> 
> /usr/lib/pymodules/python2.6/django/shortcuts/__init__.py in <module>()
>      8 from django.http import HttpResponse, Http404
>      9 from django.http import HttpResponseRedirect,
> HttpResponsePermanentRedirect
> ---> 10 from django.db.models.manager import Manager
>     11 from django.db.models.query import QuerySet
>     12 from django.core import urlresolvers
> 
> /usr/lib/pymodules/python2.6/django/db/__init__.py in <module>()
>      8 __all__ = ('backend', 'connection', 'DatabaseError', 'IntegrityError')
>      9
> ---> 10 if not settings.DATABASE_ENGINE:
>     11     settings.DATABASE_ENGINE = 'dummy'
>     12
> 
> /usr/lib/pymodules/python2.6/django/utils/functional.pyc in
> __getattr__(self, name)
>    267     def __getattr__(self, name):
>    268         if self._wrapped is None:
> --> 269             self._setup()
>    270         if name == "__members__":
>    271             # Used to implement dir(obj)
> 
> dhana013 ~ $ ipython
> Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
> Type "copyright", "credits" or "license" for more information.
> 
> IPython 0.10 -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object'. ?object also works, ?? prints more.
> 
> In [1]: from django.shortcuts import render_to_response
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call last)
> 
> /home/dhana013/<ipython console> in <module>()
> 
> /usr/lib/pymodules/python2.6/django/shortcuts/__init__.py in <module>()
>      8 from django.http import HttpResponse, Http404
>      9 from django.http import HttpResponseRedirect,
> HttpResponsePermanentRedirect
> ---> 10 from django.db.models.manager import Manager
>     11 from django.db.models.query import QuerySet
>     12 from django.core import urlresolvers
> 
> /usr/lib/pymodules/python2.6/django/db/__init__.py in <module>()
>      8 __all__ = ('backend', 'connection', 'DatabaseError', 'IntegrityError')
>      9
> ---> 10 if not settings.DATABASE_ENGINE:
>     11     settings.DATABASE_ENGINE = 'dummy'
>     12
> 
> /usr/lib/pymodules/python2.6/django/utils/functional.pyc in
> __getattr__(self, name)
>    267     def __getattr__(self, name):
>    268         if self._wrapped is None:
> --> 269             self._setup()
>    270         if name == "__members__":
>    271             # Used to implement dir(obj)
> 
> 
> /usr/lib/pymodules/python2.6/django/conf/__init__.pyc in _setup(self)
>     36             # NOTE: This is arguably an EnvironmentError, but
> that causes
> 
>     37             # problems with Python's interactive help.
> 
> ---> 38             raise ImportError("Settings cannot be imported,
> because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
>     39
>     40         self._wrapped = Settings(settings_module)
> 
> ImportError: Settings cannot be imported, because environment variable
> DJANGO_SETTINGS_MODULE is undefined.
> 
> In [2]:
> 
> /usr/lib/pymodules/python2.6/django/conf/__init__.pyc in _setup(self)
>     36             # NOTE: This is arguably an EnvironmentError, but
> that causes
> 
>     37             # problems with Python's interactive help.
> 
> ---> 38             raise ImportError("Settings cannot be imported,
> because environment variable %s is undefined." % ENVIRONMENT_VARIABLE)
>     39
>     40         self._wrapped = Settings(settings_module)
> 
> ImportError: Settings cannot be imported, because environment variable
> DJANGO_SETTINGS_MODULE is undefined.
> 
> In [2]:
> 
> -Ganesh.
> 
> Did I learn something today? If not, I wasted it.
> 
> -- 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to