Django アプリのテスト バージョンと実稼働バージョンを別々の apache 名の仮想ホストにセットアップしたいと考えており、これを行うための最良の方法を知りたいと考えていました。
これが私がやったことであり、うまくいくようですが、もっと良い方法があるかどうか疑問に思っています。
<VirtualHost *>
ServerName test.foo.bar
<Location "/app/">
SetHandler python-program
PythonPath "['/home/jdm/django-apps/xyz/test/'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonOption django.root /app
PythonDebug On
PythonInterpreter test
</Location>
</VirtualHost>
<VirtualHost *>
ServerName live.foo.bar
<Location "/app/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/home/jdm/django-apps/xyz/live/'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE settings
PythonOption django.root /app
PythonDebug On
PythonInterpreter live
</Location>
</VirtualHost>
アプリは /home/jdm/django-apps/xyz/live/ および /home/jdm/django-apps/xyz/test/ にあります。アプリはhttp://live.foo.bar/app/およびhttp://test.foo.bar/app/にあります。