Pythonywhere尝试上载我的网站

Pythonywhere尝试上载我的网站,python,python-2.7,flask,beautifulsoup,pythonanywhere,Python,Python 2.7,Flask,Beautifulsoup,Pythonanywhere,我正试图在PythonyWhere上上传我的web应用程序,但我无法做到。我尝试了很多方法,也在谷歌上搜索过,但我无法解决它。请告诉我我缺少什么或者我应该在这里补充什么信息。我还添加了PythonAnywhere的错误日志。请有人解释我的错误,如果可能的话,我做错了什么 我的文件结构 |-mysite/ flask_app.py |-templates/ index.html run.py from flask import render_template fr

我正试图在PythonyWhere上上传我的web应用程序,但我无法做到。我尝试了很多方法,也在谷歌上搜索过,但我无法解决它。请告诉我我缺少什么或者我应该在这里补充什么信息。我还添加了PythonAnywhere的错误日志。请有人解释我的错误,如果可能的话,我做错了什么

我的文件结构

|-mysite/
    flask_app.py
    |-templates/
        index.html
run.py

from flask import render_template
from bs4 import BeautifulSoup, element
import urllib2
from flask import Flask
app = Flask(__name__)

@app.route('/')
  def index():
  i=1
  count =1
  items = []
  heads = []
  bodys = []
  writers = []
  dates=[]
  m = 0
  while(i<21):
      url = 'http://www.goal.com/en-gb/rumours/last/168?page='+str(i)+'&ICID=OP'
      response = urllib2.urlopen(url)
      html = response.read()
      soup = BeautifulSoup(html)
      i +=1

      # Collect rumors posts
      rumour_post_tags = soup.find_all("div", {"id":"rumours"})


      for rumour_tags in rumour_post_tags:
          content_tags = rumour_tags.find_all("div",{"class":"rumour-content"})
          for rumour in content_tags:
             items.append(count)
             count +=1
             heads.append(rumour.find("h3",{'class':'column'}).text)
             bodys.append(rumour.find('p').text)
             for sources in rumour.find_all('span',{'class':'column'}):
                 for source in sources:
                     if m % 2 == 0:
                         writers.append(source)
                         m += 1
                     else:
                         dates.append(source)
                         m += 1
  return render_template('index.html',allitems=zip(items,heads,bodys,writers,dates))
当我试图通过
http://rahul3103.pythonanywhere.com/
,即:

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
错误日志:

2015-07-29 11:17:57,179 :Exception on / [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/rahul3103/mysite/flask_app.py", line 19, in index
    response = urllib2.urlopen(url)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Forbidden
WSGI配置文件:

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

import sys

# add your project directory to the sys.path
project_home = u'/home/rahul3103/mysite'
if project_home not in sys.path:
    sys.path = [project_home] + sys.path

# import flask app but need to call it "application" for WSGI to work
from flask_app import app as application
#此文件包含为用户提供服务所需的WSGI配置
#web应用程序位于http://.pythonanywhere.com/
#它通过将变量“application”设置为某种类型的WSGI处理程序来工作
#描述。
#
#以下内容已为您的Flask项目自动生成
导入系统
#将项目目录添加到sys.path
项目_home=u'/home/rahul3103/mysite'
如果项目不在sys.path中:
sys.path=[project_home]+sys.path
#导入flask应用程序,但需要将其称为“应用程序”,WSGI才能工作
从应用程序导入应用程序作为应用程序

这是因为你有一个免费帐户,Pythonywhere只允许访问互联网一段时间。

还有其他方法吗,我可以这样做吗Yeah goal.com不在那里,我的网站在heroku上直播。谢谢你的帮助。可能重复的
# This file contains the WSGI configuration required to serve up your
# web application at http://<your-username>.pythonanywhere.com/
# It works by setting the variable 'application' to a WSGI handler of some
# description.
#
# The below has been auto-generated for your Flask project

import sys

# add your project directory to the sys.path
project_home = u'/home/rahul3103/mysite'
if project_home not in sys.path:
    sys.path = [project_home] + sys.path

# import flask app but need to call it "application" for WSGI to work
from flask_app import app as application