2

I have created basic chatbot using FLASK framework and Python. This will create a default URL http://127.0.0.1/5000. Below link is similar to my chatbot. ex: https://dev.to/sahilrajput/build-a-chatbot-using-flask-in-5-minutes-574i

This link will work until the execution opened. If I end it, this URL will not work.

My requirement is to put this chatbot in another webpage (Like how IRCTC has Disha).

Please guide me how to proceed from here.

fresskoma
  • 25,481
  • 10
  • 85
  • 128
ramu246
  • 51
  • 1
  • 8
  • I if understand you correctly you are asking on how to **deploy** your chatbot, that is, make it available somewhere else than your local computer? – fresskoma Oct 07 '20 at 13:01
  • yes. You are right @fresskoma – ramu246 Oct 07 '20 at 13:04
  • Does this answer your question? [How to deploy python script?](https://stackoverflow.com/questions/52187362/how-to-deploy-python-script) – fresskoma Oct 07 '20 at 13:11
  • I am little confused I already have a webpage. so this BOT need to be placed on this webpage. Do creating an API from this python and calling in the webpage will not work? – ramu246 Oct 07 '20 at 13:22
  • From the question I'm going to assume that the webpage you currently have deployed is not written in Python. Different types of projects may require differnt types of deployments. For example, it's easy to deploy a PHP application because typical WebHosters will just provide you with a location to upload some code to, and then it'll be executed on request. In your particular case, deploying a Flask application (as far as I know) is a little more involved, and the easiest way would probably be to deploy it to a free Heroku app and see where you can go from there. – fresskoma Oct 07 '20 at 13:48
  • yes. my webpage is not written in Python. I will explore more about teh Heroku app thanks for your suggestons – ramu246 Oct 07 '20 at 13:54

2 Answers2

3

The thing you're trying to do is called deployment or deploying and application. Long story short, you'll need to rent space on somebody else's computer. This can be done at different providers, e.g.

fresskoma
  • 25,481
  • 10
  • 85
  • 128
0

Also as addition to fresskomas answer:

You will need a fixed external IP. Otherwise any ip-related api-calls in your code will fail when your provider changes your ip (which happens regularly if you don't order a fixed ip).

And when you do this on a local machine not exposed to the web, you probably need to forward your port in your router to allow external web-api callers to find your flask-chatbot.

4lexKidd
  • 158
  • 1
  • 1
  • 9