Hi,
I use Django 0.95 with python 2.4.4 on Fedora Core 6.
I want to use the object_list generic view from
django.views.generic.list_detail.object_list, but whenever i use the
following command (in a python shell)
>>> from django.views.generic import list_detail
I get the following error.
///
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/views/generic/list_detail.py",
line 1, in ?
    from django.template import loader, RequestContext
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/__init__.py",
line 894, in ?
    add_to_builtins('django.template.defaultfilters')
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/__init__.py",
line 891, in add_to_builtins
    builtins.append(get_library(module_name))
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/__init__.py",
line 880, in get_library
    mod = __import__(module_name, '', '', [''])
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/template/defaultfilters.py",
line 5, in ?
    from django.utils.translation import gettext
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/utils/translation/__init__.py",
line 3, in ?
    if settings.USE_I18N:
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/conf/__init__.py",
line 27, in __getattr__
    self._import_settings()
  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/conf/__init__.py",
line 52, in _import_settings
    raise EnvironmentError, "Environment variable %s is undefined." %
ENVIRONMENT_VARIABLE
EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is
undefined.
///
I can understand that I've to change the DJANGO_SETTINGS but how can it
be done?
I've consulted the documentation that says that by using import
<django_proj>.settings.main the problem can be solved but where is the
main.py or the settings directory (settings is just a file).

Thanking in advance
Thejaswi Puthraya


--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to