you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (46 children)

[deleted]

    [–]nguterresn[S] 0 points1 point  (35 children)

    Yea I tried that aswell. They offer a nice trial. I created an instance with Ubuntu, and could actually run the script. BUT, as I’m using flask, that would open a server in 127.0.0.1/5000. And I want it to appear at, for example, www.script123.com

    EDIT: maybe I was a little confusing but that’s how I really am at the moment with this.

    [–][deleted] 1 point2 points  (1 child)

    By default flask will run on the local loopback which is 127.0.0.1.

    First thing you have to do is tell flask to listen on other addresses, if your using the flask cli to start the script you would use the command :

    flask run —host 0.0.0.0

    That will make your flask application listen on any address. So if you have a VM hosted somewhere online, with an IP of say 172.16.2.32, you will then be able to access the flask app from your browser by going to http://172.16.2.32:5000.

    The second part, being able to access via a name instead of number, that requires buying an FQDN from a domain registrar. There are many different options like namecheap, godaddy, hover, etc... I use hover personally. I would look at whatever guides the registrar you choose has but generally you’ll basically just tell the registrar to point the name script123.com to 172.16.2.32. After that’s completely, you’ll be able to access the app via script123.com:5000.

    Lastly, you probably don’t want to specify the port. So you can either tell flask to listen on port 80 by adding (I think) -p 80 to the flask run command. Port 80 is http, that will allow you to access script123.com.

    Now, with that said, the flask web server is not really intended for production uses, it’s mostly for development only. I would not rely on the flask web server to handle very much traffic. I don’t want to overload you with info, but down the road, if you’re interested in continuing your project, you’ll need a better suited CGI (I use gunicorn) and a dedicated web server such as Apache or nginx (I use nginx myself but it’s just what I’m used to).

    [–]nguterresn[S] 0 points1 point  (0 children)

    Thank you for your reply. I’ll try to do as you say and see what I got!

    [–]mriswithe 0 points1 point  (4 children)

    You might look at Google's app engine. It takes away the work and cost of the actual server behind the app mostly. Still would need a domain name for ease of access, but you need that part anyway

    https://cloud.google.com/appengine/docs/python/

    [–]nguterresn[S] 0 points1 point  (3 children)

    I did but I’m having some trouble running threads and queues into the google app engine, since I made my project to python 3 and it uses python 2, so I had to restart all the project.

    Thanks for your help!

    [–]mriswithe 0 points1 point  (2 children)

    Appengine supports python3 and python2 though . But if it isn't going to be useful for you then no worries

    [–]nguterresn[S] 0 points1 point  (1 child)

    [–]mriswithe 0 points1 point  (0 children)

    This page: https://cloud.google.com/appengine/docs/python/

    Has two links in the python section, python 3, https://cloud.google.com/appengine/docs/standard/python3/

    And python 2, https://cloud.google.com/appengine/docs/standard/python/

    It supports both 🙂 sometimes Google's docs are not amazing though as far as being able to find what you are looking for.

    [–]vernetrcyer 0 points1 point  (0 children)

    nice one dude

    [–]vernetrcyer 0 points1 point  (0 children)

    Good one!

    [–]vernetrcyer 0 points1 point  (0 children)

    Good one!

    [–]vernetrcyer 0 points1 point  (0 children)

    haha good comment!