0

A website has been developed on a local ubuntu machine using python flask. The website runs fine on ubuntu at 127.0.0.1:5000. This website is supposed to go live on a godaddy server for which there is cpanel access. How to do it?

Pradeep Kumar Jha
  • 877
  • 4
  • 15
  • 30
  • You also need to get it ready for production. You shouldnt just deploy it and run it like you would locally - https://flask.palletsprojects.com/en/1.1.x/deploying/ – Craicerjack Dec 20 '19 at 12:27
  • this article is huge. can you be more specific please, which section? – Pradeep Kumar Jha Dec 20 '19 at 13:04
  • sounds like you'd be using the self hosted option and then you need to choose which one suits the server and which one you want to go with. – Craicerjack Dec 20 '19 at 14:38

2 Answers2

1

If it's a shared hosting solution, Answer to your question is NO, you can't do it. In a shared hosting environment Godaddy using only a PHP Stack. so you won't be able to use python there. Either go with VPS and configure your server. or go with a cloud service provider like Digital ocean, AWS, Linode etc.,

dineshh912
  • 148
  • 1
  • 13
  • it is possible to login to the godaddy server via ssh, install python3 and execute the code there locally. the server is on linux millenium. not enough? – Pradeep Kumar Jha Dec 20 '19 at 13:06
  • Yes, if you have access to the ssh, you can do that. Then you need to use Ngnix or wsgi mod to properly make it production-ready. again the backup of the server, load balancing all the things you need to take care of. I would suggest go with a digital ocean, or aws it's easy compared to this. – dineshh912 Dec 20 '19 at 15:32
0

If your CPanel has the "Setup Python App" option (it's CloudLinux-based), you can try to deploy there.

I had a problem where only the root URL would work and all other routes returned 404.

Add the following to the top of your .htaccess file:

RewriteEngine on
RewriteRule ^http://%{HTTP_HOST}%{REQUEST_URI} [END,NE]

Got this info from: https://stackoverflow.com/a/63971427/10122266

Apologies that I couldn't add this as a comment as I do not have sufficient rights yet. But this solution worked for me and it would be a pitty if this little gem is hidden from those who may arrive here.

So would appreciate if this post is not deleted.

taiff
  • 89
  • 8