wsgi django not working

Posted by MaKo on Stack Overflow See other posts from Stack Overflow or by MaKo
Published on 2012-04-08T05:24:06Z Indexed on 2012/04/08 5:29 UTC
Read the original article Hit count: 240

Filed under:
|
|

im installing django,

the test for wsgi is ok, but when i point my default file to the django test, it doesnt work,

this is the test that works fine:

default: /etc/apache2/sites-available/default

<VirtualHost *:80>
    ServerName www.example.com
    ServerAlias example.com
    ServerAdmin [email protected]
    DocumentRoot /var/www

    <Directory /var/www/documents>
    Order allow,deny
    Allow from all
    </Directory>
    WSGIScriptAlias / /home/ubuntu/djangoProj/micopiloto/application.wsgi
    <Directory /home/ubuntu/djangoProj/mysitio/wsgi_handler.py>
    Order allow,deny
    Allow from all
    </Directory> 
</VirtualHost>

application.wsgi:: ~/djangoProj/micopiloto

import os 
import sys 

sys.path.append('/srv/www/cucus/application') 
os.environ['PYTHON_EGG_CACHE'] = '/srv/www/cucus/.python-egg' 

def application(environ, 
start_response):

     status = '200 OK'

     output = 'Hello World!MK SS9 tkt kkk'

     response_headers = [('Content-type', 'text/plain'),

                                     ('Content-Length', str(len(output)))]

     start_response(status, response_headers)


     return [output]

but if I change the default to point to application_sa.wsgi the django test, it doesnt work :(

application_sa.wsgi

import os, sys

sys.path.append('/home/ubuntu/djangoProj/micopiloto') 


os.environ['DJANGO_SETTINGS_MODULE'] = 'micopiloto.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

I restart the apache server every time i change the wsgi to test,

so what im i missing?

thanks a lot!

© Stack Overflow or respective owner

Related posts about python

Related posts about django