开发者

Problem w/Apache2.2+psycopg2.2.2+mod_wsgi on Ubuntu

So I'm having a problem similar to others I've seen people complain about on Windows, but it appears theirs is a Windows only problem being fixed in a new version of psycopg2.

Basically, I am trying access my deployed application only to get the following in the logs.

[Fri Feb 25 16:29:26 2011] [error] [client 5.7.0.205] TemplateSyntaxError: Caught ImproperlyConfigured while rendering: 'django.db.backends.postgresql_psycopg2' isn't an available database backend. 
[Fri Feb 25 16:29:26 2011] [error] [client 5.7.0.205] Try using django.db.backends.XXX, where XXX is one of:
[Fri Feb 25 16:29:26 2011] [error] [client 5.7.0.205]     'dummy', 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3'
[Fri Feb 25 16:29:26 2011] [error] [client 5.7.0.205] Error was: cannot import name utils

I seem to have everything properly install, using buildout to retr开发者_JS百科ieve dependencies and such. I was also able to successfully run syncdb against my database and see the tables get created.

Why is it having problems dealing with the fact that I have configured it to use postgresql_psycopg2? It doesn't even make it to doing anything special. I can request "myserver/" or "myserver/admin" or "myserver/whothehellcares" and I constantly get the same 500 error.

As far as Apache goes, I used the basic site already configured and simply added the one line WSGIScriptAlias pointing to my wsgi file. I've even tried using WSGIDaemonProcess to target a specific user (www-data) for running the processes but that didn't have any effect.

Any thoughts or help is appreciated.


On non Windows systems, can be a 32 vs 64 bit problem.

Create a WSGI hello world script as described in:

http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide

Once you have the hello world script working, add at the start of it imports for the psycopg2 module you wish to use and validate that it can be imported. Ensure the import you use forces the import of the C extension .so for the pyscopy2 client module.

If it fails you may get a better error in the Apache error logs. Django can sometimes mask the real error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜