Abdul Rehman
Abdul Rehman

Reputation: 5644

Deploy Django 1.10 app with python 3.6 on Google Compute Engine

I have created a project using with Django 1.10.5 and python 3.6, now I need to deploy this project on google compute engine.I have googled a lot but couldn't find any clear guide to deploy my Django app on compute engine.

What I have tried:

  1. Create a compute engine instance
  2. Install python 3.6 (But not succeded that's why using pre-installed python 3.5.2)
  3. Setup pip and virtualenv
  4. Create a virtualenv and clone my project from GitHub
  5. Install all requirements from requirements.txt
  6. now when I try to run my app as python manage.py runserver from my directory, it says :

Django version 1.10.5, using settings 'brain.settings'

Starting development server at http://127.0.0.1:8000/

Quit the server with CONTROL-C.

  1. when I visit http://127.0.0.1:8000/ doesn't load any page.

How can I deploy my Django 1.10 & Python 3.6 app on google compute engine? Help me, please! Thanks in advance!

Upvotes: 4

Views: 3049

Answers (1)

Thomas Schwärzl
Thomas Schwärzl

Reputation: 9917

All you need to do is to add a new incoming Firewall rule on Google Cloud Platform (GCP) for TCP:8000.

To do so simply connect to your GCP: Console Firewall Rules and add a new rule.

Also be sure to launch Django to listen on the public interface and you to access with the public IP.

python manage.py runserver 0.0.0.0:8000

Upvotes: 5

Related Questions