简体   繁体   中英

django ImportError on production

I am very new to Python and django dev. I have a strange problem.

I have some custom classes in a common directory. enums.py and navigation_helper.py . Then I import them in my views like this:

from getTOD.common.enums import DocTypeEnum, SignupStepEnum
from getTOD.common.navigation_helper import NavHelper

When running locally with manage.py runserver, it all works no problem. I call methods in those classes without any issues.

But now once I have deployed to the productions server on AWS that uses apache2 to host the site, I am getting this error:

Exception Value: No module named navigation_helper

But the strange thing is, enums classes above that works fine on production and I have no idea what could cause something like this. I have re-uploaded the entire site and deleted all the .pyc files and restarted apache, but get same error. I even tried switching the two lines order around, but all that changes the the line number the error is happening on.

I have spent hours trying to figure this out, but I cannot for the life of me get it working.

It is django 1.7 if that helps at all

Thanks in advance for the help

Thanks guys. I figured it out. It was the n00best issue ever. The problem was that .py file did not have execute permissions for httpd user. Gave that user execute permission to that file and problem solved!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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