W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
If all other deployment methods do not work, CGI will work for sure. CGIis supported by all major servers but usually has a less-than-optimalperformance.
This is also the way you can use a Werkzeug application on Google'sAppEngine [http://code.google.com/appengine/], there however the execution does happen in a CGI-likeenvironment. The application's performance is unaffected because of that.
First you need to create the CGI application file. Let's call ityourapplication.cgi:
#!/usr/bin/python
from wsgiref.handlers import CGIHandler
from yourapplication import make_app
application = make_app()
CGIHandler().run(application)
If you're running Python 2.4 you will need the wsgiref [http://docs.python.org/dev/library/wsgiref.html#module-wsgiref] package. Python2.5 and higher ship this as part of the standard library.
Usually there are two ways to configure the server. Either just copy the.cgi into a cgi-bin (and use mod_rerwite or something similar torewrite the URL) or let the server point to the file directly.
In Apache for example you can put a like like this into the config:
ScriptAlias /app /path/to/the/application.cgi
For more information consult the documentation of your webserver.
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: