Re: mod_wsgi, apache, windows XP

2010-09-24 Thread chauhonglinh
I believe that the error
[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

is a problem in the file django/db/backends/postgresql_psycopg2/
base.py, version 2.2.2, line number 9
from django.db import utils

I don't know why it happens, because in the directory 'djtrunk/django/
db/', there is a file named 'utils.py'

Probably a privilege issue?

Anybody has any idea?

-- 
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.



Re: mod_wsgi, apache, windows XP

2010-09-07 Thread Margie Roswell
my settings.py on slicehost is publicly readable. Is that just a
permissions issue?

No, it has same permissions. as another server where the settings.py
can't be downloaded...

Of course, we don't want people to see the database password.

How is this usually resolved?

Margie


On Mon, Sep 6, 2010 at 4:50 AM, Graham Dumpleton
 wrote:
> You can do that with mod_wsgi as well. Go to the mod_wsgi site and
> read the ConfigurationGuidelines page on the wiki.
>
> Sorry, can't paste link right now.
>
> Graham
>
> On Sep 6, 4:27 pm, Elim Qiu  wrote:
>> I followed a installation instruction and got
>> Apache/2.2.15 (Win32) SVN/1.6.12 mod_wsgi/3.3 Python/2.7 PHP/5.2.5 DAV/2
>> installed OK. Meaning that
>> I inserted the following lines to my httpd.conf:
>>
>> LoadModule wsgi_module modules/mod_wsgi.so
>> WSGIScriptAlias /wsgi "F:/Apache/appwsgi/wsgi_handler.py"
>>
>> #test the above byhttp://localhost/wsgi
>>
>> 
>> AllowOverride None
>> Options None
>> Order deny,allow
>> Allow from all
>> 
>>
>> ===
>> With the wsgi_handler.py content:
>>
>> 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]
>>
>> ===
>> Then enter the url  http://localhost/wsgi  in the browser to get
>>
>> Hello World!
>>
>> ===
>>
>> So my wod_wsgi worked fine. But why python is so special compare with perl?
>>
>> With perl (I'm not saying it's nicer), I need only specify the script
>> alis to cgi-bin dir and then I can run many perl scripts installed in
>> cgi-bin. But with python and mod_wsgi, My WSGIScriptAlias only points
>> to a single python script?
>>
>> Sorry I'm just so new to this.  There must be something  I don't know but 
>> cool
>
> --
> 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.
>
>



-- 
Margie
--
http://www.BaltimoreUrbanAg.org
http://www.Real-Food-Farm.org
http://www.FriendlyCoffeehouse.org
http://www.packtpub.com/drupal-5-views-recipes/book

-- 
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.



Re: mod_wsgi, apache, windows XP

2010-09-06 Thread Graham Dumpleton
You can do that with mod_wsgi as well. Go to the mod_wsgi site and
read the ConfigurationGuidelines page on the wiki.

Sorry, can't paste link right now.

Graham

On Sep 6, 4:27 pm, Elim Qiu  wrote:
> I followed a installation instruction and got
> Apache/2.2.15 (Win32) SVN/1.6.12 mod_wsgi/3.3 Python/2.7 PHP/5.2.5 DAV/2
> installed OK. Meaning that
> I inserted the following lines to my httpd.conf:
>
> LoadModule wsgi_module modules/mod_wsgi.so
> WSGIScriptAlias /wsgi "F:/Apache/appwsgi/wsgi_handler.py"
>
> #test the above byhttp://localhost/wsgi
>
> 
> AllowOverride None
> Options None
> Order deny,allow
> Allow from all
> 
>
> ===
> With the wsgi_handler.py content:
>
> 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]
>
> ===
> Then enter the url  http://localhost/wsgi  in the browser to get
>
> Hello World!
>
> ===
>
> So my wod_wsgi worked fine. But why python is so special compare with perl?
>
> With perl (I'm not saying it's nicer), I need only specify the script
> alis to cgi-bin dir and then I can run many perl scripts installed in
> cgi-bin. But with python and mod_wsgi, My WSGIScriptAlias only points
> to a single python script?
>
> Sorry I'm just so new to this.  There must be something  I don't know but cool

-- 
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.



Re: mod_wsgi, apache, windows XP

2010-09-06 Thread Elim Qiu
I followed a installation instruction and got
Apache/2.2.15 (Win32) SVN/1.6.12 mod_wsgi/3.3 Python/2.7 PHP/5.2.5 DAV/2
installed OK. Meaning that
I inserted the following lines to my httpd.conf:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias /wsgi "F:/Apache/appwsgi/wsgi_handler.py"

#test the above by http://localhost/wsgi


AllowOverride None
Options None
Order deny,allow
Allow from all


===
With the wsgi_handler.py content:

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]

===
Then enter the url   http://localhost/wsgi   in the browser to get

Hello World!

===

So my wod_wsgi worked fine. But why python is so special compare with perl?

With perl (I'm not saying it's nicer), I need only specify the script
alis to cgi-bin dir and then I can run many perl scripts installed in
cgi-bin. But with python and mod_wsgi, My WSGIScriptAlias only points
to a single python script?


Sorry I'm just so new to this.  There must be something  I don't know but cool

-- 
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.



RE: mod_wsgi, apache, windows XP

2010-09-05 Thread Anna Leslie
Hello Reinout, 

I downgraded to python 2.6 and thus all the other programs and still no
luck.  But, didn't you say you've been able to run it with Python 2.6?
Also, someone else says that Mysql runs fine.   I don't like MySQL, because
of its sloppy referential integrity, but my project isn't so large that I
couldn't use it.  I will try playing around with Apache one last time with
postgres first.  I will let you know if I have any luck.  

Thanks for staying in touch with this problem!



-Original Message-
From: django-users@googlegroups.com [mailto:django-us...@googlegroups.com]
On Behalf Of Reinout van Rees
Sent: Sunday, September 05, 2010 1:20 PM
To: django-users@googlegroups.com
Subject: Re: mod_wsgi, apache, windows XP

On 09/03/2010 05:38 PM, Anna Leslie wrote:
> 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??

Sorry, no solution.  Frustrated rant below, perhaps it helps yo uto know 
that you're not alone... :-)


Windows, I guess?  I have never ever seen this problem under linux.  But 
I've been bashing my head on a windows install problem for a full week. 
(Well, a 80 hour week instead of the regular 40 hour week).

I could not solve the postgres problem. Paths all seemed OK.  The 
relevant postres stuff is installed globally.  So both apache (mod_wsgi) 
and "runserver" should be able to find it.  But apache fails to find it. 
  No way to debug as I've got no windows experience.  Everything looks 
right.

"Luckily" the oracle driver (it was supposed to connect to an oracle db 
after all) did work OK.  At least, until you talked to a certain 
database in multi-treaded mode.  Telling (via OPTIONS={'threaded':True} 
in the database settings) it to run in multi-treaded mode didn't help. 
Something somewhere (no error messages) kept crashing.  I dived into 
a couple of the python libraries (pdb and so), but I couldn't check 
every detail.  And the c-level libraries were beyond me.

In the end I got it working (that is, "not actively dying") by telling 
apache to run with just one single thread... That's some solution...


This is the first time that a hard problem took more than 1.5 day to 
fix.  Effectively, this is 2 full work weeks.  And still no real solution.




Reinout


-- 
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Collega's gezocht!
Django/python vacature in Utrecht: http://tinyurl.com/35v34f9

-- 
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.



Re: mod_wsgi, apache, windows XP

2010-09-05 Thread Reinout van Rees

On 09/03/2010 05:38 PM, Anna Leslie wrote:

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??


Sorry, no solution.  Frustrated rant below, perhaps it helps yo uto know 
that you're not alone... :-)



Windows, I guess?  I have never ever seen this problem under linux.  But 
I've been bashing my head on a windows install problem for a full week. 
(Well, a 80 hour week instead of the regular 40 hour week).


I could not solve the postgres problem. Paths all seemed OK.  The 
relevant postres stuff is installed globally.  So both apache (mod_wsgi) 
and "runserver" should be able to find it.  But apache fails to find it. 
 No way to debug as I've got no windows experience.  Everything looks 
right.


"Luckily" the oracle driver (it was supposed to connect to an oracle db 
after all) did work OK.  At least, until you talked to a certain 
database in multi-treaded mode.  Telling (via OPTIONS={'threaded':True} 
in the database settings) it to run in multi-treaded mode didn't help. 
Something somewhere (no error messages) kept crashing.  I dived into 
a couple of the python libraries (pdb and so), but I couldn't check 
every detail.  And the c-level libraries were beyond me.


In the end I got it working (that is, "not actively dying") by telling 
apache to run with just one single thread... That's some solution...



This is the first time that a hard problem took more than 1.5 day to 
fix.  Effectively, this is 2 full work weeks.  And still no real solution.





Reinout


--
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Collega's gezocht!
Django/python vacature in Utrecht: http://tinyurl.com/35v34f9

--
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.



RE: mod_wsgi, apache, windows XP

2010-09-03 Thread Anna Leslie
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 
[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 
[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

[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

[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

[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


Re: mod_wsgi, apache, windows XP

2010-09-03 Thread Reinout van Rees

On 09/03/2010 12:34 PM, Graham Dumpleton wrote:



On Sep 3, 7:46 am, Jesse  wrote:

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


A settings.py that imports from other django applications... Ok, so 
that's dangerous.


Hm. I also have two or three of those lines in my settings.py.  I'm by 
now convinced that "settings.py only gets loaded once so that's a nice 
place to put it" is wrong.  So I'm probably better off adding lines I 
want run only once to one of my django applications' __init__py?  I *do* 
want to be sure they're called before my site starts answering requests.



Reinout

--
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Collega's gezocht!
Django/python vacature in Utrecht: http://tinyurl.com/35v34f9

--
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.



Re: mod_wsgi, apache, windows XP

2010-09-03 Thread Graham Dumpleton


On Sep 3, 7:46 am, 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.
> [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  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"
>
> > 
> > Order allow,deny
> > Allow from all
> > 
>
> > The apache_django_wsgi.conf file has the following:
> > //start code
> > Alias /media/ "c:/public/media/"
>
> > 
> > Order allow, deny
> > Option Indexes
> > Allow from all
> > IndexOptions FancyIndexing
> > 
>
> > WSGIScriptAlias / "c:/public/apache/django.wsgi"
>
> >  > Order deny,allow
> > Allow from all
> > 
>
> > //end code
>
> > The error is Request operation failed.
>
> > Thx for your help!!
>
> > Jesse
> > On Sep 1, 8:53 pm, Graham Dumpleton 
> > wrote:
>
> > > On Sep 2, 1:13 pm, Jesse  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"
>
> > > > 
> > > > Order allow,deny
> > > > Allow from all
> > > > 
>
> > > > 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 
> > > > wrote:
>
> > > > > On Sep 2, 4:46 am, Jesse  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/
>
> > > > > > 
> > > > > > Order deny,allow
> > > > > > Allow from all
> > > > > > 
>
> > > > > > WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi
>
> > > > > > 
> > > > > > Order deny,allow
> > > > > > Allow from all
> > > > > > 
> > > > > > //code ends
>
> > > > > > 6.  Added following line toApachehttp.conf
> > > > > > Include "c:/django/testproject/apache/apache_django_wsgi.conf"
>
> > > > > > 7.  Apacheerror, cannot restart.
>
> > > > > > Any help is 

Re: mod_wsgi, apache, windows XP

2010-09-03 Thread Reinout van Rees

On 09/02/2010 11:46 PM, 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.
[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


I got the same error with python 2.6, mod_wsgi, windows.  Even though 
psycopg2 was installed perfectly.  Just half a minute earlier my 
"manage.py syncdb" created the database :-)  And "runserver" works fine, 
only when running it under apache does this error crop up.


Graham has an article on the differences in running runserver versus 
django's own wsgi handling:

http://blog.dscpl.com.au/2010/03/improved-wsgi-script-for-use-with.html

I haven't figured out yet what's wrong.  I'm using buildout's 
djangorecipe to set it all up and djangorecipe's wsgi file does most of 
the tricks that Graham's improved wsgi script does.



Weird error.


Reinout

--
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Collega's gezocht!
Django/python vacature in Utrecht: http://tinyurl.com/35v34f9

--
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.



Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Mike Dewhirst

On 3/09/2010 2:16pm, Jesse wrote:

I have django and postgres working on the local django server.  I had
to install psycopg2-2.2.2.win32-py2.7 in order for that to work.  I
don't believe I have access to an earlier version of psycopg.  Are you
using postgres?


Yes but a different stack - python 2.6, the same revision of postgresl 
and psycopg2. I run the django development server on Win XP and Apache 
2.2 on linux. I leave postgresql running on the XP machine and point the 
linux setup at it across the LAN so I can use development machine data 
for the time being. Works well.


I haven't been following this thread closely but I do remember some time 
ago getting the same error because I had forgotten to install psycopg2 
when deploying to the linux machine.


Your error actually says django either can't find the backend you have 
specified in your settings.py or it can find it but it isn't available 
for some reason.


I would be investigating the database side of things. Without googling I 
would know whether there might be any subtle psycopg2 version problems 
but I'd eliminate everything else as a possibility first.


Mike


Jesse

On Sep 2, 5:41 pm, Mike Dewhirst  wrote:

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.





--
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.



Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Jesse
I have django and postgres working on the local django server.  I had
to install psycopg2-2.2.2.win32-py2.7 in order for that to work.  I
don't believe I have access to an earlier version of psycopg.  Are you
using postgres?
Jesse

On Sep 2, 5:41 pm, Mike Dewhirst  wrote:
> 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  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"
>
> >> 
> >> Order allow,deny
> >> Allow from all
> >> 
>
> >> The apache_django_wsgi.conf file has the following:
> >> //start code
> >> Alias /media/ "c:/public/media/"
>
> >> 
> >> Order allow, deny
> >> Option Indexes
> >> Allow from all
> >> IndexOptions FancyIndexing
> >> 
>
> >> WSGIScriptAlias / "c:/public/apache/django.wsgi"
>
> >>  >> Order deny,allow
> >> Allow from all
> >> 
>
> >> //end code
>
> >> The error is Request operation failed.
>
> >> Thx for your help!!
>
> >> Jesse
> >> On Sep 1, 8:53 pm, Graham Dumpleton
> >> wrote:
>
> >>> On Sep 2, 1:13 pm, Jesse  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"
>
>  
>  Order allow,deny
>  Allow from all
>  
>
>  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
>  wrote:
>
> > On Sep 2, 4:46 am, Jesse  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/
>
> >> 
> >> Order deny,allow
> >> Allow from all
> >> 
>
> >> WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi
>
> >> 
> >> Order deny,allow
> >> Allow from all
> >> 
> >> //code ends
>
> 

Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Mike Dewhirst

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  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"


Order allow,deny
Allow from all


The apache_django_wsgi.conf file has the following:
//start code
Alias /media/ "c:/public/media/"


Order allow, deny
Option Indexes
Allow from all
IndexOptions FancyIndexing


WSGIScriptAlias / "c:/public/apache/django.wsgi"



//end code

The error is Request operation failed.

Thx for your help!!

Jesse
On Sep 1, 8:53 pm, Graham Dumpleton
wrote:




On Sep 2, 1:13 pm, Jesse  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"




Order allow,deny
Allow from all




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
wrote:



On Sep 2, 4:46 am, Jesse  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/




Order deny,allow
Allow from all




WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi




Order deny,allow
Allow from all

//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.



Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Jesse
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

Thank you!

On Sep 2, 9:10 am, Jesse  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"
>
> 
> Order allow,deny
> Allow from all
> 
>
> The apache_django_wsgi.conf file has the following:
> //start code
> Alias /media/ "c:/public/media/"
>
> 
> Order allow, deny
> Option Indexes
> Allow from all
> IndexOptions FancyIndexing
> 
>
> WSGIScriptAlias / "c:/public/apache/django.wsgi"
>
>  Order deny,allow
> Allow from all
> 
>
> //end code
>
> The error is Request operation failed.
>
> Thx for your help!!
>
> Jesse
> On Sep 1, 8:53 pm, Graham Dumpleton 
> wrote:
>
>
>
> > On Sep 2, 1:13 pm, Jesse  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"
>
> > > 
> > > Order allow,deny
> > > Allow from all
> > > 
>
> > > 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 
> > > wrote:
>
> > > > On Sep 2, 4:46 am, Jesse  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/
>
> > > > > 
> > > > > Order deny,allow
> > > > > Allow from all
> > > > > 
>
> > > > > WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi
>
> > > > > 
> > > > > Order deny,allow
> > > > > Allow from all
> > > > > 
> > > > > //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:
>
> > > >  

Re: mod_wsgi, apache, windows XP

2010-09-02 Thread Jesse
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"


Order allow,deny
Allow from all


The apache_django_wsgi.conf file has the following:
//start code
Alias /media/ "c:/public/media/"


Order allow, deny
Option Indexes
Allow from all
IndexOptions FancyIndexing


WSGIScriptAlias / "c:/public/apache/django.wsgi"



//end code

The error is Request operation failed.

Thx for your help!!

Jesse
On Sep 1, 8:53 pm, Graham Dumpleton 
wrote:
> On Sep 2, 1:13 pm, Jesse  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"
>
> > 
> > Order allow,deny
> > Allow from all
> > 
>
> > 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 
> > wrote:
>
> > > On Sep 2, 4:46 am, Jesse  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/
>
> > > > 
> > > > Order deny,allow
> > > > Allow from all
> > > > 
>
> > > > WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi
>
> > > > 
> > > > Order deny,allow
> > > > Allow from all
> > > > 
> > > > //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.



Re: mod_wsgi, apache, windows XP

2010-09-01 Thread Graham Dumpleton


On Sep 2, 1:13 pm, Jesse  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"
>
> 
> Order allow,deny
> Allow from all
> 
>
> 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 
> wrote:
>
>
>
> > On Sep 2, 4:46 am, Jesse  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/
>
> > > 
> > > Order deny,allow
> > > Allow from all
> > > 
>
> > > WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi
>
> > > 
> > > Order deny,allow
> > > Allow from all
> > > 
> > > //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.



Re: mod_wsgi, apache, windows XP

2010-09-01 Thread Jesse
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"


Order allow,deny
Allow from all


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.
Jesse

On Sep 1, 4:25 pm, Graham Dumpleton 
wrote:
> On Sep 2, 4:46 am, Jesse  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/
>
> > 
> > Order deny,allow
> > Allow from all
> > 
>
> > WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi
>
> > 
> > Order deny,allow
> > Allow from all
> > 
> > //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.



Re: mod_wsgi, apache, windows XP

2010-09-01 Thread Graham Dumpleton


On Sep 2, 4:46 am, Jesse  wrote:
> created project using startproject testproject
>
> Problems with apache_django_wsgi.conf
> 1.  Added following line to Apache:
> 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.  Apache starts and restarts. local host is original apache "It
> works"
>
> 5.  Created file c:/django/testproject/apache_django_wsgi.conf
> //code starts
> Alias /media/ /c:/django/testproject/media/
>
> 
> Order deny,allow
> Allow from all
> 
>
> WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi
>
> 
> Order deny,allow
> Allow from all
> 
> //code ends
>
> 6.  Added following line to Apache http.conf
> Include "c:/django/testproject/apache/apache_django_wsgi.conf"
>
> 7.  Apache error, cannot restart.
>
> Any help is much appreciated.

Does the Apache error log have anything in it?

Which Apache version? Which Python version? Which mod_wsgi object did
you grab, or did you compile from source code?

Are you trying to run 64bit Windows?

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.



mod_wsgi, apache, windows XP

2010-09-01 Thread Jesse
created project using startproject testproject

Problems with apache_django_wsgi.conf
1.  Added following line to Apache:
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")

os.environ['DJANGO_SETTINGS_MODULE'] = 'testproject.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()
// code ends

4.  Apache starts and restarts. local host is original apache "It
works"

5.  Created file c:/django/testproject/apache_django_wsgi.conf
//code starts
Alias /media/ /c:/django/testproject/media/


Order deny,allow
Allow from all


WSGIScriptAlias / /c:/django/testproject/apache/django.wsgi


Order deny,allow
Allow from all

//code ends

6.  Added following line to Apache http.conf
Include "c:/django/testproject/apache/apache_django_wsgi.conf"

7.  Apache error, cannot restart.

Any help is much appreciated.
Jesse

-- 
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.