我更新了wsgi.py使其看起来像这样:
import osimport sysimport sitesite.addsitedir(os.path.join('/home/ubuntu/ve','project/lib/python2.6/site-packages'))sys.path.append(os.path.abspath(os.path.dirname(__file__)))sys.path.append(os.path.join(os.path.realpath(os.path.dirname(__file__)), '../../../'))sys.path.append(os.path.join(os.path.realpath(os.path.dirname(__file__)), '../../'))os.environ['DJANGO_SETTINGS_MODULE'] = 'project.configs.staging.settings'import django.core.handlers.wsgiapplication = django.core.handlers.wsgi.WSGIHandler()我的uwsgi.conf文件现在看起来像这样:
# file: /etc/init/uwsgi.confdescription "uWSGI starter"start on (local-filesystems and runlevel [2345])stop on runlevel [016]respawn# home - is the path to our virtualenv directory# pythonpath - the path to our django application# module - the wsgi handler python scriptexec /home/ubuntu/ve/project/bin/uwsgi --uid ubuntu --pythonpath /home/ubuntu/django-projects/project/project/configs/staging -H /home/ubuntu/ve/project --socket /tmp/uwsgi.sock --chmod-socket 644 --module wsgi --logdate --optimize 2 --processes 2 --master --logto /home/ubuntu/logs/project/uwsgi.log
我的nginx网站可用文件如下所示:
# file: /etc/nginx/sites-available/yourdomain.com# nginx configuration for project.maumercado.comserver { listen 80; charset utf-8; server_name project.maumercado.com; access_log /home/ubuntu/logs/project/nginx/access.log; error_log /home/ubuntu/logs/project/nginx/error.log; location ^~ /cache/ { root /home/ubuntu/django-projects/project/project/media; expires max; } location / { uwsgi_pass unix:/tmp/uwsgi.sock; include /etc/nginx/uwsgi_params; }}现在它的工作非常完美,我在样式方面遇到了一些问题,因为在css文件中使用了像ñ这样的奇怪字符。
现在,我想知道当需要使用uwsgi在同一服务器上运行更多项目时该怎么办?



