将django项目上传到pythonanywhere时出现File Not Found错误

时间:2015-07-27 16:46:31

标签: python django excel

我试图将django项目上传到pythonanywhere免费帐户。该项目有几个excel文件,我需要解析(使用xlrd模块)

这是我在python中的文件映射

-prvgroups
  -PRVGROUPS
  -***.xlsx
  -***.xlsx
  -***.xlsx

django抛出以下错误

FileNotFoundError at /

我尝试从CDN引用excel文件,但它仍无法找到excel路径

我的WSGI文件:

import os
import sys
#
## assuming your django settings file is at '/home/KjPacino/mysite/mysite/settings.py'
## and your manage.py is is at '/home/KjPacino/mysite/manage.py'
#path = '/home/KjPacino/mysite'
path = '/home/KjPacino/prvgroups'
if path not in sys.path:
    sys.path.append(path)
#
os.environ['DJANGO_SETTINGS_MODULE'] = 'PRVGroups.settings'
#
## then, for django >=1.5:
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
## or, for older django <=1.4
#import django.core.handlers.wsgi
#application = django.core.handlers.wsgi.WSGIHand

我的settings.py文件

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

修改

我的pythonpath似乎也指向了正确的方向

Python Path:    

['/var/www',
 '.',
 '',
 '/var/www',
 '/home/KjPacino/.virtualenvs/sandbox/lib/python3.4',
 '/home/KjPacino/.virtualenvs/sandbox/lib/python3.4/plat-x86_64-linux-gnu',
 '/home/KjPacino/.virtualenvs/sandbox/lib/python3.4/lib-dynload',
 '/usr/lib/python3.4',
 '/usr/lib/python3.4/plat-x86_64-linux-gnu',
 '/home/KjPacino/.virtualenvs/sandbox/lib/python3.4/site-packages',
 '/home/KjPacino/prvgroups']

0 个答案:

没有答案