pythonanywhere上的ModuleNotFoundError

时间:2018-10-19 00:06:23

标签: python django pythonanywhere

任何想法我应该在哪里寻找解决方案?我的django专案在pythonanywhere上运作良好。然后,我向该项目添加了一个新应用,该应用在本地运行良好。但是,当我git用新应用将项目拖到PythonAnywhere时,出现以下错误:

2018-10-18 23:38:56,622: Error running WSGI application
2018-10-18 23:38:56,637: ModuleNotFoundError: No module named 'catalog.apps'
2018-10-18 23:38:56,637:   File "/var/www/aceh40_pythonanywhere_com_wsgi.py", line 21, in <module>
2018-10-18 23:38:56,637:     application = get_wsgi_application()

这是WSGI文件的内容:

settings_path = '/home/aceh40/aceh40.pythonanywhere.com/aceh40'
sys.path.insert(0, settings_path)


dotenv_path = os.path.expanduser('~/aceh40.pythonanywhere.com')  # adjust as appropriate
load_dotenv(os.path.join(dotenv_path, '.env'))

# Set environment variable to tell django where your settings.py is
os.environ['DJANGO_SETTINGS_MODULE'] = 'aceh40.settings'

# Set the 'application' variable to the Django wsgi app
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

1 个答案:

答案 0 :(得分:0)

问题出在未提交的文件上。提交所有文件可解决此问题。