Forums

Defining a variable with a url causes 500 internal server error

Hi Everyone,

I'm not new to python but am new to pythonanywhere and web hosting. I'm trying to host a simple Amazon Alexa app using flask-ask. I can get a "hello world" app to respond properly when tested via the amazon alexa skill console. However, as soon as I define a variable with a URL string value in my code on PA, the entire app responds with a 500 error. I know basic accounts are limited to whitelisted sites but I have a 'hacker' paid account. Any tips on how to troubleshoot this would be greatly appreciated.

Working code:

@ask.intent('HelloIntent')
def basic_function():
#endpoint = "https://www.google.com"
    return statement('placeholder statement').simple_card('placeholder statement')

Breaks:

@ask.intent('HelloIntent')
def basic_function():
endpoint = "https://www.google.com"
return statement('placeholder statement').simple_card('placeholder statement')

I'm not even using the variable with the google URL yet it still causes a 500 error when amazon tries testing the app. Thanks again for any help.

What is the error in your error log?

Thank you for your response. I just realized the error log timestamps are 8 hours ahead of my local time which means I was previously looking at the wrong time. There ended up being an unindent error which resolved the 500 issue when addressed. What a lame first post on the forum -__- Thanks again!

Glad you worked it out!