配色: 字号:
uwsgi
2013-01-13 | 阅:  转:  |  分享 
  
1.vim/usr/bin/uwsgi_restart

#!/bin/bash



#killuwsgipid

killall-9uwsgi



#startuwsgi

uwsgi-x/srv/www/rhino/rhino_website/rhino_website/uwsgi.xml--enable-threads-b8192--daemonize/var/log/rhino_website-uwsgi.log

2.cat/srv/www/rhino/rhino_website/rhino_website/uwsgi.xml





127.0.0.1:9000

/srv/www/rhino/rhino_website/rhino_website

..

wsgi





3.vim/srv/www/rhino/rhino_website/rhino_website/wsgi.py





"""

WSGIconfigforheatherproject.



ThismodulecontainstheWSGIapplicationusedbyDjango''sdevelopmentserver

andanyproductionWSGIdeployments.Itshouldexposeamodule-levelvariable

named``application``.Django''s``runserver``and``runfcgi``commandsdiscover

thisapplicationviathe``WSGI_APPLICATION``setting.



UsuallyyouwillhavethestandardDjangoWSGIapplicationhere,butitalso

mightmakesensetoreplacethewholeDjangoWSGIapplicationwithacustomone

thatlaterdelegatestotheDjangoone.Forexample,youcouldintroduceWSGI

middlewarehere,orcombineaDjangoapplicationwithanapplicationofanother

framework.



"""

importos



os.environ.setdefault("DJANGO_SETTINGS_MODULE","rhino_website.settings")



#ThisapplicationobjectisusedbyanyWSGIserverconfiguredtousethis

#file.ThisincludesDjango''sdevelopmentserver,iftheWSGI_APPLICATION

#settingpointshere.

fromdjango.core.wsgiimportget_wsgi_application

application=get_wsgi_application()



#ApplyWSGImiddlewarehere.

#fromhelloworld.wsgiimportHelloWorldApplication

#application=HelloWorldApplication(application)

献花(0)
+1
(本文系python_dian...首藏)