Python论坛  - 讨论区

标题:[python-chinese] Django连接postgreSQL出错

2007年01月10日 星期三 09:28

王志伟 windtake在gmail.com
星期三 一月 10 09:28:44 HKT 2007

djangoÁ¬½ÓpostgreSQLµÄʱºò±¨Õâô¸ö´í£¬ÒѾ­°²×°pyGreSQLÁË¡£ÏÈл¹ý¸÷λ¡£

Traceback (most recent call last):

  File "D:\Python24\lib\site-packages\django\core\servers\basehttp.py",
line 272, in run
    self.result = application(self.environ, self.start_response)

  File "D:\Python24\lib\site-packages\django\core\servers\basehttp.py",
line 611, in __call__
    return self.application(environ, start_response)

  File "D:\Python24\lib\site-packages\django\core\handlers\wsgi.py",
line 143, in __call__
    self.load_middleware()

  File "D:\Python24\lib\site-packages\django\core\handlers\base.py",
line 29, in load_middleware
    mod = __import__(mw_module, '', '', [''])

  File "D:\Python24\lib\site-packages\django\contrib\sessions\middleware.py",
line 2, in ?
    from django.contrib.sessions.models import Session

  File "D:\Python24\lib\site-packages\django\contrib\sessions\models.py",
line 3, in ?
    from django.db import models

  File "D:\Python24\lib\site-packages\django\db\__init__.py", line 11, in ?
    backend = __import__('django.db.backends.%s.base' %
settings.DATABASE_ENGINE, '', '', [''])

  File "D:\Python24\lib\site-packages\django\db\backends\postgresql\base.py",
line 12, in ?
    raise ImproperlyConfigured, "Error loading psycopg module: %s" % e

ImproperlyConfigured: Error loading psycopg module: No module named psycopg

¿´³ö´íºÃÏñÊÇȱÉÙpsycopgÕâ¸öÄ£¿é£¬ÓÚÊÇ°²×°Á˸öpsycopg2-2.0.5.1.win32-py2.4-pg8.2.0-release.exe£¬¿ÉÊÇ»¹ÊÇ
²»Ðеġ£


-- 
Best regard!
Yours windtake!
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20070110/61f47f2b/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年01月10日 星期三 11:40

yi huang yi.codeplayer在gmail.com
星期三 一月 10 11:40:56 HKT 2007

On 1/10/07, 王志伟 <windtake at gmail.com> wrote:
>
> django连接postgreSQL的时候报这么个错,已经安装pyGreSQL了。先谢过各位。
>
> Traceback (most recent call last):
>
>   File "D:\Python24\lib\site-packages\django\core\servers\basehttp.py", line 272, in run
>     self.result = application(
> self.environ, self.start_response)
>
>   File "D:\Python24\lib\site-packages\django\core\servers\basehttp.py", line 611, in __call__
>     return self.application(environ, start_response)
>
>   File "D:\Python24\lib\site-packages\django\core\handlers\wsgi.py", line 143, in __call__
>
>     self.load_middleware()
>
>   File "D:\Python24\lib\site-packages\django\core\handlers\base.py", line 29, in load_middleware
>     mod = __import__(mw_module, '', '', [''])
>
>
>   File "D:\Python24\lib\site-packages\django\contrib\sessions\middleware.py", line 2, in ?
>     from django.contrib.sessions.models import Session
>
>   File "D:\Python24\lib\site-packages\django\contrib\sessions\models.py", line 3, in ?
>
>     from django.db import models
>
>   File "D:\Python24\lib\site-packages\django\db\__init__.py", line 11, in ?
>     backend = __import__('django.db.backends.%s.base' % settings.DATABASE_ENGINE
> , '', '', [''])
>
>   File "D:\Python24\lib\site-packages\django\db\backends\postgresql\base.py", line 12, in ?
>     raise ImproperlyConfigured, "Error loading psycopg module: %s" % e
>
>
> ImproperlyConfigured: Error loading psycopg module: No module named psycopg
>
> 看出错好像是缺少psycopg这个模块,于是安装了个psycopg2-2.0.5.1.win32-py2.4-pg8.2.0-release.exe,可是还是
> 不行的。
>
>
> --
> Best regard!
> Yours windtake!
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>

摘录django文档 <http://www.djangoproject.com/documentation/install>如下:

If you're using PostgreSQL, you'll need the
psycopg<http://initd.org/projects/psycopg1>package (version
1.1 -- not version 1.0 or version 2, which is still in beta). If you're on
Windows, check out the unofficial compiled Windows
version<http://stickpeople.com/projects/python/win-psycopg/>
.

-- 
http://codeplayer.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://python.cn/pipermail/python-chinese/attachments/20070110/6d29604a/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年01月10日 星期三 16:59

张成 czhang.mlist在gmail.com
星期三 一月 10 16:59:30 HKT 2007

应该这样写:
DATABASE_ENGINE = 'postgresql_psycopg2'
官方文档可能还没有更新,不过在官方邮件列表上已经确认了 psycopg2 已经足 
够稳定,不推荐再使用 psycopg 啦。

在 2007-1-10,上午11:40,yi huang 写道:

> On 1/10/07, 王志伟 <windtake在gmail.com> wrote:
> django连接postgreSQL的时候报这么个错,已经安装pyGreSQL了。先谢过各位。
> Traceback (most recent call last):
>
> File "D:\Python24\lib\site-packages\django\core\servers 
> \basehttp.py", line 272, in run
> self.result = application(
> self.environ, self.start_response)
>
> File "D:\Python24\lib\site-packages\django\core\servers 
> \basehttp.py", line 611, in __call__
> return self.application(environ, start_response)
>
> File "D:\Python24\lib\site-packages\django\core\handlers\wsgi.py",  
> line 143, in __call__
>
> self.load_middleware()
>
> File "D:\Python24\lib\site-packages\django\core\handlers\base.py",  
> line 29, in load_middleware
> mod = __import__(mw_module, '', '', [''])
>
>
> File "D:\Python24\lib\site-packages\django\contrib\sessions 
> \middleware.py", line 2, in ?
> from django.contrib.sessions.models import Session
>
> File "D:\Python24\lib\site-packages\django\contrib\sessions 
> \models.py", line 3, in ?
>
> from django.db import models
>
> File "D:\Python24\lib\site-packages\django\db\__init__.py", line  
> 11, in ?
> backend = __import__('django.db.backends.%s.base' %  
> settings.DATABASE_ENGINE
> , '', '', [''])
>
> File "D:\Python24\lib\site-packages\django\db\backends\postgresql 
> \base.py", line 12, in ?
> raise ImproperlyConfigured, "Error loading psycopg module: %s" % e
>
>
> ImproperlyConfigured: Error loading psycopg module: No module named  
> psycopg
>
> 看出错好像是缺少psycopg这个模块,于是安装了个psycopg2-2.0.5.1.win32- 
> py2.4-pg8.2.0-release.exe,可是还是
> 不行的。
>
> -- 
> Best regard!
> Yours windtake!
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to   python-chinese- 
> request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
> 摘录django文档如下:
>
> If you're using PostgreSQL, you'll need the psycopg package  
> (version 1.1 -- not version 1.0 or version 2, which is still in  
> beta). If you're on Windows, check out the unofficial compiled  
> Windows version.

-张成
Gentoo/PostgreSQL/Lighttpd/Python/Django/jQuery Powered
(Web) http://www.aragonconsultinggroup.com
(Blog) http://my.donews.com/czhang/
爱发现 (http://www.ifaxian.com)
第一个 Django 开发的中文网站 ;-)
爱游网 (http://www.aiyo.cn)
我们的第二个 Django 作品



[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号