Reputation: 3648
This question is very similar to (but is not the same because I am running on the google cloud, which I suspect may be cause of the issue):
I am trying to set up an api running on a VM-instance on the google cloud platform. So far I got nginx working (when I go to the ip address it greats me with a welcome message). When I run:
python3 manage.py runserver 0.0.0.0:8000
I get the following output:
Performing system checks...
System check identified no issues (0 silenced).
February 06, 2019 - 09:27:13
Django version 2.1.5, using settings 'my_api.settings.development'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
Which seems good, but when I go to any of the following pages (all of which I've listed under allowed_hosts):
The page won't load.
I´ve tried checking which ports are used using
netstat
And I've killed all programs using this port after which I restarted my program, but to no avail.
At this point, I've fixed everything suggested in other posts and I'm out of ideas. What would be the next step in finding/solving the cause of my internet page not loading?
Upvotes: 0
Views: 2132
Reputation: 549
Make sure http traffic is enabled
Make a firewall rule like so:
Upvotes: 0
Reputation: 3648
As @JohnHanley points out, I needed to create a firewall rule.
I did this by:
Upvotes: 0
Reputation: 81336
You will need to create a firewall rule to allow inbound traffic on tcp port 8000
.
When creating the firewall rule, also specify a Target tag
so that you can assign the firewall rule to the instance. Another option is to specify a service account such as Compute Engine default service account
to assign the rule based upon identity.
Filtering by service account vs. network tag
Upvotes: 5