Django Book 翻译
菜单>:
TOC
返回
原文:
The next step should be to edit your test code and add an import of any Django-specific code youre using your views, your models, your URLconf, your RSS configuration, and so forth. Put these imports in your test handler function and access your test URL in a browser. If this causes a crash, youve confirmed its the importing of Django code that causes the problem. Gradually reduce the set of imports until it stops crashing, so as to find the specific module that causes the problem. Drop down further into modules and look into their imports as necessary. For more help, system tools like ``ldconfig`` on Linux, ``otool`` on Mac OS, and ``ListDLLs`` (from SysInternals) on Windows can help you identify shared dependencies and possible version conflicts.
翻译:
下一个步骤应该是编辑一段测试代码,把你所有django相关代码import进去,你的views,models,URLconf,RSS配置,等等。把这些imports放进你的handler函数中,然后从浏览器进入你的URL。如果这些导致了crash,你就可以确定是import的django代码引起了问题。逐个去掉这些imports,直到不再冲突,这样就能找到引起问题的那个模块。 深入了解各模块,看看它们的imports。要想获得更多帮助,像linux的ldconfig,Mac OS的otool和windows的ListDLLs(form sysInternals)都可以帮你识别共享依赖和可能的版本冲突。
备注:
译者: