Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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!!!
Posted
Comments
Fynn Pfingsten 19-Jan-21 14:52pm    
I found out, that this happens when i import send *

This is a file which is using selenium chromedriver.

I found out that i get a lot of errors from chromedriver.

If i test send.py single it is working.

Do you have an idea for that mistake???

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900