我想在不同的apache虚拟主机上设置Django应用程序的测试和生产版本,并想知道实现这一目标的最佳方法。
这是我所做的,它似乎工作得很好,但我想知道是否有更好的方法。
<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/
发布于 2010-03-09 17:14:39
我认为virtualenv就是你所需要的。
https://stackoverflow.com/questions/2407347
复制相似问题