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

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