简体   繁体   English

django - ImportError

[英]django - ImportError

I just successfully shipped my code to the production server. 我刚刚将代码成功发送到生产服务器。 You can check out here http://qlimp.com 你可以在这里查看http://qlimp.com

It shows 表明

ImportError at /
No module named try.urls

Exception Type: ImportError
Exception Value:    No module named try.urls
Exception Location: /home/nirmal/project/local/lib/python2.7/site-packages/django/utils/importlib.py in import_module, line 35
Python Executable:  /home/nirmal/project/bin/python

Actually my django project name in the developement server is try . 实际上我在开发服务器中的django项目名称是try Then I exported the code to the project qlimp in the production server. 然后我将代码导出到生产服务器中的项目qlimp I successfully performed every changes need to be done and I don't know why it shows that No module named try.urls 我成功完成了所有需要完成的更改,我不知道为什么它显示No module named try.urls

I'm using Ubuntu 12.04 LTS on my production server. 我在我的生产服务器上使用Ubuntu 12.04 LTS。 Could anyone guide me? 谁能指导我?

Thanks! 谢谢!

In settings.py, change 在settings.py中,更改

ROOT_URLCONF = 'try.urls'

to

ROOT_URLCONF = 'qlimp.urls'

Not so much a straight answer as a few things to check - I'd suggest (if you haven't already) that you grep the new project for the string "try.urls". 不是一个简单的答案,而是作为一些要检查的东西 - 我建议(如果你还没有)你为字符串“try.urls”grep新项目。 Looks to me like the sort of thing that might happen if you missed changing over a config file or something. 在我看来,如果您错过了更改配置文件或其他内容可能会发生的事情。 If you have the patience for it, you might even try grepping "try". 如果你有耐心,你甚至可以尝试点击“尝试”。 Also, make sure that you've done a make clean to clear out any references that may be in compiled code. 另外,请确保已完成make clean以清除编译代码中可能包含的任何引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM