部署Django应用程序,如何让South工作?
我的错误日志中出现以下错误: TemplateSyntaxError:渲染时捕获 ImportError:没有名为 South 的模块
我执行了“easy_install South”在我的服务器上安装 South,但仍然收到错误。
南在我的 settings.py 的 INSTALLED_APPS 下列为“南”。我认为它无法找到“南方”。如何找出“south”的安装位置并为我的settings.py提供完整路径?
我认为我在httpd.conf中的python路径不包括south所在的路径。如何知道南在哪里?
I am getting the following error in my error logs:
TemplateSyntaxError: Caught ImportError while rendering: No module named south
I did "easy_install South" to install South on my server, but I still get the error.
South is listed under INSTALLED_APPS of my settings.py as just 'south'. I think that it is not able to find 'south'. How do I figure out the location of where 'south' is installed and give my settings.py the full path?
I think that my python path in httpd.conf is not including the path where south is. How do I find out where south is located?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现,如果您使用像 pinax 这样的虚拟环境,则必须将其安装在虚拟环境中,而不是计算机中。所以你首先要让环境运转起来:
- annasob$ 源 pinax-env/bin/activate
然后执行以下操作:
-
(pinax-env)annasob$ sudo pip install South
I found that if you are using a virtual environment like pinax you have to install it in your virtual environment and not your computer. So you would first get the environment going:
-
annasob$ source pinax-env/bin/activate
and then do:
-
(pinax-env)annasob$ sudo pip install south
如果您想找出 South 的安装位置,您可以在磁盘中搜索 South。
在 Linux 中,您可以通过几种方式做到这一点,您可以使用 find 或locate(确保您的locate 数据库是最新的)。在 Windows 上,您可以使用 Windows 文件搜索。在 Mac 上,您可以使用聚光灯。
由于您没有使用 virtualenv,那么这些文件很可能安装在 site-packages 目录中,我很确定,但我可能是错的,site-packages 通常位于 sys 路径上。
如果您的计算机上安装了多个版本的 python,则有可能您安装了一个版本,然后使用不同的版本运行 mod_wsgi。
If you want to find out where south is installed you could search your disk for south.
With Linux you could do this a few ways, you could use find or locate (make sure your locate databases is up to date) . On Windows you can use the windows file search. On Mac you can use spotlight.
Since you are not using virtualenv, then the files are most likely installed in a site-packages directory, and I'm pretty sure, but I could be wrong, the site-packages are normally on the sys path.
If you have more then one version of python installed on your machine, it might be possible, that you installed into one version and then are running mod_wsgi using a different one.