无法使用apache mod_wsgi部署django

时间:2014-03-16 18:39:57

标签: python django apache debian

我试图在debian服务器上使用apache和wsgi部署django,但我仍然遇到一个错误:

ImportError: Could not import settings 'sinalite_app.settings' (Is it on sys.path...

我按照本书配置了所有内容,这个错误仍让我头疼。 我已经使用命令a2ensite sinalite_app

添加了应用程序

项目的路径(它位于manage.py所在的位置)是:

/home/brockroot2/spider/sinalite

settings.py路径:

/home/brockroot2/spider/sinalite/sinalite_app

wsgi文件:

import os
import sys

from django.core.handlers.wsgi import WSGIHandler
sys.path.append('/home/brockroot2/spider/sinalite')

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sinalite_app.settings")
application = WSGIHandler()


apache file conf:

    <VirtualHost *:80>
    ServerAdmin webmaster@printeriscoming.com
    ServerName printeriscoming.com
    ServerAlias www.printeriscoming.com

    WSGIScriptAlias / var/www/printeriscoming.com/index.wsgi

    Alias /static/ /var/www/printeriscoming.com/static/
    <Location "/static/">
        Options -Indexes
    </Location>
    </VirtualHost>

0 个答案:

没有答案