if i run this code:
from flask import render_template
import connexion
# Create the application instance
app = connexion.App(__name__, specification_dir='./')
# Read the swagger.yml file to configure the endpoints
app.add_api('swagger.yml')
# Create a URL route in our application for "/"
@app.route('/')
def home():
"""
This function just responds to the browser ULR
localhost:80/home
:return: the rendered template 'home.html'
"""
return render_template('home.html')
# If we're running in stand alone mode, run the application
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
In file server.py everthing is working fine.
I now added # to the following code:
#if __name__ == '__main__':
# app.run(host='0.0.0.0', port=5000, debug=True)
I imported this script from server.py to init.py because i want to run this code on apache2!
If I run the code with a apache2-restart the server says: Internal Server Error
Has anyone an idea? The code is working fine if i start the server.py by terminal but if i put the code to the init.py it isnt working anymore...
What I have tried:
I tryed to change file name but it doesnt work!!!