apache uwsgi django

http://projects.unbit.it/uwsgi/wiki/Example

  

[root@i projectname]# cat django_wsgi.py
import os
#substitute mysite with the name of your project !!!
os.environ[‘DJANGO_SETTINGS_MODULE‘] = ‘projectname.settings‘

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

  

<VirtualHost *:80>
  <Location />
    SetHandler uwsgi-handler
    uWSGISocket 127.0.0.1:3031
  </Location>
</VirtualHost>

  

# cat uwsgi/uwsgi.xml 
<uwsgi>
  <socket>127.0.0.1:3031</socket>
  <chdir>/var/www/html/horizon</chdir>
  <pythonpath>..</pythonpath>
  <module>django_wsgi</module>
</uwsgi>

  

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。