我想將我的Python項目鏈接到wsgi
文件。我正在使用mod_wsgi
。如何將Python項目鏈接到WSGI文件?
我想我的Python項目位於/var/www/myProject/start.py
。
我已經配置了Apache如下:
<VirtualHost *:80>
ServerName www.example.me
ServerAlias example.me
ServerAdmin [email protected]
DocumentRoot /usr/local/www/documents
LogLevel warn
Alias /robots.txt /usr/local/www/documents/robots.txt
Alias /favicon.png /usr/local/www/documents/favicon.png
Alias /media/ /usr/local/www/documents/media/
<Directory /usr/local/www/documents>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias//usr/local/www/wsgi-scripts/myApp.wsgi
<Directory /usr/local/www/wsgi-scripts>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
到目前爲止,這是我在myApp.wsgi
文件:
import web
urls = (
'/.*', 'hello',
)
class hello:
def GET(self):
return "Hello, world"
application = web.application(urls, globals()).wsgifunc()
我有什麼,爲了做到將我的項目,位於/var/www/myProject/start.py
將由myApp.wsgi
調用?