Setting up Django on Google Cloud (basic server)

58 views
Skip to first unread message

Samuel Muiruri

unread,
Jan 20, 2018, 9:54:49 AM1/20/18
to pyth...@python.org, django...@googlegroups.com
I had this issue before with AWS i remember it was just as stressful then and actually can't remember what actually fixed it. I basically have a clean Ubuntu VM which I followed this guide https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 step by step on creating and hosting django on a site.

Every step worked smoothly until this point when I need to run the command "python manage.py runserver 0.0.0.0:8000" which starts the service (shown on the attached screenshot) (also is the google cloud page showing the given external ip) according to this with the server waiting visiting http://35.227.49.155:8000/ should bring the site or something but it fails to connect i get "

This site can’t be reached

" message.

For now I'm taking a break hoping I'll come up with something, also hope someone here who might have gone through the same or is a seasoned web dev might also help too.

--
Best Regards,
Samuel Muiruri.
Senior Developer @ Revorta.
snap 2.JPG
snap 3.JPG

Nick Sarbicki

unread,
Jan 20, 2018, 11:59:14 AM1/20/18
to django...@googlegroups.com, pyth...@python.org

Hi Samuel,

You probably haven't opened access to port 8000 to the public

Try run server on port 80.

Nick.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJZFZXrw9O-x8aV6NynHN9iEiLd%3DMZU8OpHGUeEmHXUSH9wAkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Nick Sarbicki

unread,
Jan 26, 2018, 2:12:27 AM1/26/18
to UK Python Users, django...@googlegroups.com

There was a discussion on a slack channel a few days ago with someone who, suspiciously, had the same name and problem. They'd tried to set up firewall rules (not sure they worked) and was trying to get it running via port 80 with gunicorn. Haven't heard anything else so assuming fixed.


On Thu, 25 Jan 2018, 19:31 Matt Wheeler, <m...@funkyhat.org> wrote:
On Sat, 20 Jan 2018 at 14:52 Samuel Muiruri <muiruri...@gmail.com> wrote:
I had this issue before with AWS i remember it was just as stressful then and actually can't remember what actually fixed it. I basically have a clean Ubuntu VM which I followed this guide https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 step by step on creating and hosting django on a site.

Every step worked smoothly until this point when I need to run the command "python manage.py runserver 0.0.0.0:8000" which starts the service (shown on the attached screenshot) (also is the google cloud page showing the given external ip) according to this with the server waiting visiting http://35.227.49.155:8000/ should bring the site or something but it fails to connect i get "

This site can’t be reached

Have you checked the firewall rules?
I would suggest adding a tag to your Instance and then creating a firewall rule for the same tag which allows port 8000 TCP ingress.

--

--
Matt Wheeler
http://funkyh.at

_______________________________________________
python-uk mailing list
pyth...@python.org
https://mail.python.org/mailman/listinfo/python-uk
Reply all
Reply to author
Forward
0 new messages