On Feb 16, 6:49 am, ProfessionalIT <[email protected]> wrote:
> To solve I make this:
>
> in httpd.conf:
>
> #In my server, I put my app out of htdocs.
> WSGIScriptAlias /park-system "c:/apps/park-system/code.py/"
This should be:
WSGIScriptAlias /park-system "c:/apps/park-system/code.py"
You should not have a trailing slash on final argument.
> Alias /park-system/static "c:/apps/park-system/static/"
You shouldn't have this and having Alias as well as WSGIScriptAlias in
the context of your other configuration would as far as I can tell
result in nothing working.
> AddType text/html .py
You should preferably not have this. Your web application should
always explicitly set the response content type in the response
headers.
> #<File code.py>
> # SetHandler wsgi-script
> # Options ExecCGI FollowSymLinks
> #</File>
Even though commented out, delete this as just another redundant way
of doing things.
> <Directory "c:/apps/park-system/">
> Options Indexes FollowSymLinks MultiViews ExecCGI
Don't need any of these options for mod_wsgi.
> AddHandler cgi-script .cgi
If you don't have .cgi scripts, don't define it.
> AddHandler wsgi-script .wsgi
Don't need this.
> AllowOverride None
> Order allow,deny
> allow from all
> </Directory>
So, all you really needed was:
WSGIScriptAlias /park-system "c:/apps/park-system/code.py"
<Directory "c:/apps/park-system/">
Order allow,deny
Allow from all
</Directory>
>
> in code.py:
>
> #!/usr/bin/python
>
> #This is necessary to find the "web" folder.
> import sys, os
> abspath = os.path.dirname(__file__)
> sys.path.append(abspath)
> os.chdir(abspath)
>
> import web
>
> render = web.template.render('templates/')
>
> urls = (
> '/', 'index'
> )
>
> # This variable need to be called application
> application = web.application(urls, globals()).wsgifunc()
>
> class index:
> def GET(self):
> return render.index()
>
> # This line need to be comment.
> #if __name__ == "__main__": app.run()
In short, you are using multiples ways of trying to configure
mod_wsgi. You should use one only. Read:
http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines
to understand things better.
Graham
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.