0

我已经将我的几个项目部署到我的新服务器上。似乎正在发生的事情是我可以很好地查看一个项目,但是一旦我进入下一个项目,前一个项目的设置仍在使用中。

例如,jacobvalenta.net 和 dev.pawndaddy.org 都是服务器上的项目,在两者之间切换可能会导致设置混淆。

SGIPythonPath /home/projects/pawndaddy:/home/projects/jacobvalenta:/home/projects/sailcast:/home/projects/tryfecta:/home/projects/midiscribe

NameVirtualHost *:80

<VirtualHost *:80>
        ServerName jacobvalenta.net
        ServerAlias *.jacobvalenta.net

        DocumentRoot /home/projects/jacobvalenta
        WSGIScriptAlias / /home/projects/jacobvalenta/jacobvalenta/wsgi.py

        <Directory /home/projects/jacobvalenta/jacobvalenta>
                <Files wsgi.py>
                        Order deny,allow
                        Allow from all
                </Files>
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName sailcast.org
        ServerAlias *.sailcast.org

        DocumentRoot /home/projects/sailcast
        WSGIScriptAlias / /home/projects/sailcast/sailcast/wsgi.py

        <Directory /home/projects/sailcast/sailcast>
                <Files wsgi.py>
                        Order deny,allow
                        Allow from all
                </Files>
        </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerName pawndaddy.org
        ServerAlias *.pawndaddy.org

        DocumentRoot /home/projects/pawndaddy/
        WSGIScriptAlias / /home/projects/pawndaddy/pawndaddy/wsgi.py

        <Directory /home/projects/pawndaddy/pawndaddy>
                <Files wsgi.py>
                        Order deny,allow
                        Allow from all
                </Files>
        </Directory>
</VirtualHost>
4

1 回答 1

0

我应该多读一点文件!

在 wsgi.py 中,评论说:

# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "project.settings"

所以只需删除有关设置默认环境的行,一切都应该很好。

于 2013-04-05T18:54:37.960 回答