简体   繁体   中英

“Internal Server Error” with Hello World Python App

My files are as follows:

application.wsgi ( NOTE: updated as recommended from my previous question here )

import os
import sys


sys.path.append('/srv/www/mysite.com/application')

os.environ['PYTHON_EGG_CACHE'] = '/srv/www/mysite.com/.python-egg'

import flaskr.helloworld
application = flaskr.helloworld.app

helloworld.py

from flask import Flask
app = Flask(__name__)

@app.route('/')
def __init__(self):
    print 'Hello World!'

if __name__ == '__main__':
    app.run()

For what ever reason I get the following error when attempting to load. Nothing is added to my error.log, it just displays this in the browser: "Internal Server Error"

Change print 'Hello World!' to return 'Hello World!'

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