Pythonanywhere Django错误运行WSGI应用程序ImportError:

时间:2017-06-09 05:20:05

标签: python django wsgi pythonanywhere django-wsgi

我正在尝试在Pythonanywhere中构建一个webapp,并且我正在尝试安装django-filter module

我已经通过PIP安装了模块,并在settings.py和app的视图,模型和HTML页面中进行了所有必需的更改。虽然模块在我的本地机器上工作,但在Pythonanywhere中我收到以下错误

2017-06-09 05:07:18,654: Error running WSGI application
2017-06-09 05:07:18,656: ImportError: No module named 'django_filters'
2017-06-09 05:07:18,656:   File "/var/www/user_pythonanywhere_com_wsgi.py", line 29, in <module>
2017-06-09 05:07:18,656:     application = get_wsgi_application()
2017-06-09 05:07:18,657: 
2017-06-09 05:07:18,657:   File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2017-06-09 05:07:18,657:     django.setup(set_prefix=False)
2017-06-09 05:07:18,657: 
2017-06-09 05:07:18,657:   File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 27, in setup
2017-06-09 05:07:18,657:     apps.populate(settings.INSTALLED_APPS)
2017-06-09 05:07:18,657: 
2017-06-09 05:07:18,658:   File "/usr/local/lib/python3.5/dist-packages/django/apps/registry.py", line 85, in populate
2017-06-09 05:07:18,658:     app_config = AppConfig.create(entry)
2017-06-09 05:07:18,658: 
2017-06-09 05:07:18,658:   File "/usr/local/lib/python3.5/dist-packages/django/apps/config.py", line 90, in create
2017-06-09 05:07:18,658:     module = import_module(entry)

我的wsgi文件如下。我不知道如何编辑它。

# This file contains the WSGI configuration required to serve up your
# web application at http://user.pythonanywhere.com/
# It works by setting the variable 'application' to a WSGI handler of some
# description.
#
# The below has been auto-generated for your Django project

import os
import sys

# add your project directory to the sys.path
project_home = u'/home/user/django_project'
if project_home not in sys.path:
    sys.path.insert(0, project_home)



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


# serve django via WSGI in Django < 1.7
# import django.core.handlers.wsgi
# application = django.core.handlers.wsgi.WSGIHandler()
# serve django via WSGI in Django >= 1.7
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

我真的不知道如何解决这个错误。有人可以帮忙吗? TIA

0 个答案:

没有答案