skip to Main Content

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?

2

Answers


  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.,

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search