Python repl not waking up for no reason

No matter what I try, repl doesnt wake up. My code seems perfeectly fine, its a python app.

Here is my entire python code:
from flask import Flask, request

app = Flask(name)

@app.route(‘/api/text’, methods=[‘POST’])
def receive_text():
if request.is_json:
text = request.get_json()
text =‘utf-8’)
return ‘Text received’

if name == ‘main’:

Thats all the code there is…at all.

Can you please format your code like this:

Paste the code here

Other than that, can you answer some questions to help:

  • Does running with the run button work?
  • If it does, can you give us the content of the .replit config file

Hi @KailoOwhadi thanks for your post and welcome to the community!

Can you please post a link to your repl?

Here is the repl link

Running it works. It starts in the console. But there is no repl config file that I am aware of, unless you mean pyproject.toml?

I can find it with the repl link, but for future reference it is a hidden file that can be shown by clicking the three dots and then “show hidden files”. Everything seems as though it should work, the last thing I could think of is try adding an response to the index page.

1 Like


I think the issue is that you created your code in a Python template, rather than a Flask one. I made a new Flask template, copied in your code, changed one line (see below) and it started a webview immediately.

I changed this:

if __name__ == '__main__':

to this:

if __name__ == '__main__':'', port=81,debug=True)
1 Like

Oh yep thats why. I did use python isntead of flask. When trying that rn, Im getting ‘requested url not found on the server’. Do I need to change ‘’ to something?

1 Like

Glad it’s working for you. The reason you see that error is due to your @app.route as it’s missing the index page


Thanks! That did it then.

Yes you should have the host on This makes sure that Replit knows a server is running and that you’re trying to make a website.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.