On 3/09/2010 7:46am, Jesse 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.

I don't think it is a wsgi problem. This looks like you may not have installed psycopg2 on your server.


[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

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.

Reply via email to