This is in my settings file:
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.

And it works fine with the local django server.  The entire application
works fine with the local django server, but I need to get it into
production mode.  I've tried         'ENGINE': 'django.postgresql_psycopg2',
# Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
And get the opposite error under Apache saying I need to do
'django.db.backends.postgresql_psycopg2'.  I don't have the deseb statement
in my settings file, so that shouldn't be a problem.  I was going to try
downgrading to python 26, but it seems that a similar problem occurs with
it.  I don't think I can get the downgraded version of psycopg2 now, anyway.

Now I seem to have a utils problem??
Thx for any help.

[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]
default_translation = _fetch(settings.LANGUAGE_CODE)
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\utils\\translation\\trans_real.py
", line 159, in _fetch
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     app =
import_module(appname)
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\utils\\importlib.py", line 35, in
import_module
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     __import__(name)
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\contrib\\admin\\__init__.py",
line 1, in <module>
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     from
django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\contrib\\admin\\helpers.py", line
1, in <module>
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     from django import
forms
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\forms\\__init__.py", line 17, in
<module>
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     from models import
*
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\forms\\models.py", line 6, in
<module>
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     from django.db
import connections
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\db\\__init__.py", line 77, in
<module>
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     connection =
connections[DEFAULT_DB_ALIAS]
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\db\\utils.py", line 91, in
__getitem__
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     backend =
load_backend(db['ENGINE'])
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]   File
"C:\\Python27\\lib\\site-packages\\django\\db\\utils.py", line 49, in
load_backend
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     raise
ImproperlyConfigured(error_msg)
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1] TemplateSyntaxError:
Caught ImproperlyConfigured while rendering:
'django.db.backends.postgresql_psycopg2' isn't an available database
backend. 
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1] Try using
django.db.backends.XXX, where XXX is one of:
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1]     'dummy', 'mysql',
'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3'
[Fri Sep 03 08:36:25 2010] [error] [client 127.0.0.1] Error was: cannot
import name utils

-----Original Message-----
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com]
On Behalf Of Graham Dumpleton
Sent: Friday, September 03, 2010 3:34 AM
To: Django users
Subject: Re: mod_wsgi, apache, windows XP



On Sep 3, 7:46 am, Jesse <adles...@gmail.com> wrote:
> Hello Graham,
>
> I have the c:/public/apache/apache_django_wsgi.conf working now, at
> least apache restarts.  Do you know if mod_wsgi has a problem with
> these versions:
> python 2.7 and apache 2.2, and postgres 8.4, psycopg 2.2.2
>
> My server error is:
>
> TemplateSyntaxError: Caught ImproperlyConfigured while rendering:
> 'django.db.backends.postgresql_psycopg2' isn't an available database
> backend.
> [Thu Sep 02 13:46:30 2010] [error] [client 127.0.0.1] Try using
> django.db.backends.XXX, where XXX is one of:
> [Thu Sep 02 13:46:30 2010] [error] [client 127.0.0.1]     'dummy',
> 'mysql', 'oracle', 'postgresql', 'postgresql_psycopg2', 'sqlite3'
> [Thu Sep 02 13:46:30 2010] [error] [client 127.0.0.1] Error was:
> cannot import name utils

Provide the full traceback.

Sounds a bit like:

  http://code.djangoproject.com/ticket/12730

or similar. The full traceback may give a clue.

Graham

> Thank you!
>
> On Sep 2, 9:10 am, Jesse <adles...@gmail.com> wrote:
>
>
>
> > Thanks!  I did see the hello using the corrected localhost/myapp, so I
> > at least know that I have the right version of mod_wsgi.  Now I'm back
> > to my original problem.  The apache server will not restart when I add
> > the following line to the http.conf file:
>
> > Include "c:/public/apache/apache_django_wsgi.conf"
>
> > which I place before the here:
> > Include "c:/public/apache/apache_django_wsgi.conf"
> > #WSGIScriptAlias /myapp "c:/public/apache/myapp.wsgi"
>
> > <Directory "c:/public/apache">
> > Order allow,deny
> > Allow from all
> > </Directory>
>
> > The apache_django_wsgi.conf file has the following:
> > //start code
> > Alias /media/ "c:/public/media/"
>
> > <Directory "c:/public/media">
> > Order allow, deny
> > Option Indexes
> > Allow from all
> > IndexOptions FancyIndexing
> > </Directory>
>
> > WSGIScriptAlias / "c:/public/apache/django.wsgi"
>
> > <Directory "c:/public/apache"
> > Order deny,allow
> > Allow from all
> > </Directory>
>
> > //end code
>
> > The error is Request operation failed.
>
> > Thx for your help!!
>
> > Jesse
> > On Sep 1, 8:53 pm, Graham Dumpleton <graham.dumple...@gmail.com>
> > wrote:
>
> > > On Sep 2, 1:13 pm, Jesse <adles...@gmail.com> wrote:
>
> > > > I'm using Python 2.7, Apache 2.2 and grabbed the mod_wsgi that
> > > > supposedly works.  I changed the name of the file to mod_wsgi and
> > > > placed into Apache modules library.  I changed the folders, so the
> > > > apache folder by itself and created the following in the apache
> > > > http.conf file:
> > > > WSGIScriptAlias /myapp "c:/public/apache/myapp.wsgi"
>
> > > > <Directory "c:/public/apache">
> > > > Order allow,deny
> > > > Allow from all
> > > > </Directory>
>
> > > > The myapp.wsgi is:
> > > > def application(environ, start_response):
> > > >     status = '200 OK'
> > > >     output = 'Hello World!'
>
> > > >     response_headers = [('Content-type', 'text/plain'),
> > > >                         ('Content-Length', str(len(output)))]
> > > >     start_response(status, response_headers)
>
> > > >     return [output]
>
> > > > Apache starts fine, no errors, but the localhost is still the
original
> > > > apache page and not hello world.
>
> > > What URL are you using? Sounds like you are using:
>
> > >  http://localhost
>
> > > and not:
>
> > >  http://localhost/myapp
>
> > > Your WSGIScriptAlias has it mounted at sub URL not root of site which
> > > is where standard Apache 'It Works' page would be found.
>
> > > Graham
>
> > > > On Sep 1, 4:25 pm, Graham Dumpleton <graham.dumple...@gmail.com>
> > > > wrote:
>
> > > > > On Sep 2, 4:46 am, Jesse <adles...@gmail.com> wrote:
>
> > > > > > created project using startproject testproject
>
> > > > > > Problems with apache_django_wsgi.conf
> > > > > > 1.  Added following line toApache:
> > > > > > LoadModule wsgi_module modules/mod_wsgi.so
>
> > > > > > 2. Created folder c:/django/testproject/apache
>
> > > > > > 3.  Created file c:/django/testproject/apache/django.wsgi
> > > > > > // code starts
> > > > > > import os, sys
> > > > > > sys.path.append("/c:/django")
>
> > > > > All your paths where you have '/c:' instead of just 'c:' are wrong
to
> > > > > start with.
>
> > > > > > os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'
>
> > > > > > import django.core.handlers.wsgi
>
> > > > > > application = django.core.handlers.wsgi.WSGIHandler()
> > > > > > // code ends
>
> > > > > > 4.  Apachestarts and restarts. local host is originalapache"It
> > > > > > works"
>
> > > > > > 5.  Created file c:/django/testproject/apache_django_wsgi.conf
> > > > > > //code starts
> > > > > > Alias /media/ /c:/django/testproject/media/
>
> > > > > > <Directory /c:/django/testproject/media>
> > > > > > Order deny,allow
> > > > > > Allow from all
> > > > > > </Directory>
>
> > > > > > WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi
>
> > > > > > <Directory /c:/django/testproject/apache>
> > > > > > Order deny,allow
> > > > > > Allow from all
> > > > > > </Directory>
> > > > > > //code ends
>
> > > > > > 6.  Added following line toApachehttp.conf
> > > > > > Include "c:/django/testproject/apache/apache_django_wsgi.conf"
>
> > > > > > 7.  Apacheerror, cannot restart.
>
> > > > > > Any help is much appreciated.
>
> > > > > Does theApacheerror log have anything in it?
>
> > > > > WhichApacheversion? Which Python version? Which mod_wsgi object
did
> > > > > you grab, or did you compile from source code?
>
> > > > > Are you trying to run 64bitWindows?
>
> > > > > BTW, recommended to test first with a WSGI hello world program and
not
> > > > > Django.
>
> > > > > See hello world example in:
>
> > > > >  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
>
> > > > > Graham

-- 
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@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-us...@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