From: | Luis Esteban de Dios Núñez <esteban(at)princesa(dot)pri(dot)sld(dot)cu> |
---|---|
To: | "Emanuel CALVO FRANCO" <postgres(dot)arg(at)gmail(dot)com> |
Cc: | pgsql-es-ayuda(at)postgresql(dot)org |
Subject: | Re: [?? Probable Spam] Re: Acceso a postgresql desde python |
Date: | 2008-11-03 14:16:28 |
Message-ID: | op.uj2a60sr3mfjen@localhost |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-es-ayuda |
Hola,
Ya logré, con la ayuda de Uds., instalar el software, psycopg2-2.0.8, para
acceder a postgresql desde python. El problema consistía en que en el
fichero setup.cfg hay que descomentar y configurar el siguiente path:
# "pg_config" is the preferred method to locate PostgreSQL headers and
# libraries needed to build psycopg2. If pg_config is not in the path or
# is installed under a different name uncomment the following option and
# set it to the pg_config full path.
pg_config=/usr/local/pgsql/bin/pg_config
Ahora el error es otro, cuando ejecuto python y luego trato de importar el
módulo para este fin, obtengo el siguiente error:
Jerusalen:~ # python
Python 2.4.1 (#1, Sep 13 2005, 00:39:20)
[GCC 4.0.2 20050901 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.shortcuts import render_to_response
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/django/shortcuts/__init__.py",
line 9, in ?
from django.db.models.manager import Manager
File "/usr/lib/python2.4/site-packages/django/db/__init__.py", line 9,
in ?
if not settings.DATABASE_ENGINE:
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
28, in __getattr__
self._import_settings()
File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line
57, in _import_settings
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.
---------------------------------------
Red Telematica de Salud - Cuba
CNICM - Infomed
From | Date | Subject | |
---|---|---|---|
Next Message | Fernando Moreno | 2008-11-03 15:09:17 | Re: problema con trigger |
Previous Message | Javier Chávez B. | 2008-11-03 14:14:44 | Re: Campos time sin parte decimal |