deploying react and django (server side) application on googlecloud - django

I had created a web application.Front end is created by ReactJS and back-end(server side)is created by Django framework,
Here I am using PostgreSQL database.
The application is successfully running on my local machine by running both python manage.py runserver and npm start at a time in my terminal.
I need to deploy my entire app on google cloud using compute engine.
I already purchased a domain. I don't know how to connect these 2 platforms(Django and ReactJS) in cloud. if anyone knows deploy Django go as server-side and react as front-end in GooleCloud (using compute engine)

Even though your question is a bit broad, I think you may find these resources useful:
Getting started with Django [1]. You can compare the 4 main options to use Django in GCP.
Django Certified by Bitnami [2] is a ready to use pre-configured Django environment that deploys all the Compute Engine resources you need.
You can find more information on the Bitnami Django Stack For Google Cloud Platform here [3]
You could start using one of the pre-configured solutions and customize the VM by installing what you need afterwards. Or start with a blank VM and configure everything from scratch [4].
In a more general sense, this guide “Serving websites” [5] is a very good read to better understand all the options you have within Google Cloud Platform to host a website; more specifically, the section “Using virtual machines with Compute Engine” [6].
I’m assuming that you already know how to get Django and ReactJS work together, as you did it already in your local machine. I hope these articles are useful for you.
[1]https://cloud.google.com/python/django/#hosting_platforms
[2]https://cloud.google.com/marketplace/solution/bitnami-launchpad/djangostack?q=django
[3]https://docs.bitnami.com/google/infrastructure/django/
[4]https://cloud.google.com/compute/docs/instances/create-start-instance
[5]https://cloud.google.com/solutions/web-serving-overview
[6]https://cloud.google.com/solutions/web-serving-overview#compute-engine

Related

Is it possible to create a GUI with python on the Google Cloud Platform

I am trying to create a web application using python on the google cloud platform. I have followed Google's quick-start guide and completed it.
App currently just prints out text
However, I am struggling to figure out a way to create a gui. I am aware of the python modules tk and tkinter and I have tried to use those with no success. I also saw the warning in the Google Cloud Console about how installed modules only exist for the current instance of the app - but even when installing the module directly before deploying the app - it still throws an import error.
I did some research and followed this guide: https://cloud.google.com/appengine/docs/standard/python/tools/using-libraries-python-27
Assuming I didn't miss any steps - would this guide solve my problem? Or is there a better way to create a GUI?
Any suggestions are encouraged. Thanks
App Engine is web oriented service. Read about it in the overview and the appropriate gui there would be a web based one.
If you want to have a remote server that will server graphical applications look closer at Google Cloud Compute Engine where you can have a VM instance, where you can install and run any application.

Django on Digital Ocean

So I am beginner Django Developer and have been learning by developing local apps. I am looking to finally deploy something so people can use it. I have been looking around at various hosting providers and I am wondering what it's like using Digital Ocean for Django hosting. Specifically what exactly is involved/required with managing a Django app on Digital Ocean. Hostgator, which is another host I've been looking at, does not offer any "one-click" install for stuff like Nginx or anything else which I noticed Digital Ocean does have, so I would have to install that that as well as anything else I'd need myself. I guess my question is after that one click install what is involved with managing a Django app on Digital Ocean? Do I have to learn how to do a ton of other stuff regarding managing a server and dealing with Nginx (I would have to do that on HostGator) or does that One-click install for Django handle all that? Also other than Django, are there any skills that I have to learn in order to be able to do this?
Digital Ocean is more than a hosting service, it's a development platform. Digital Ocean works around the element of "droplets", where each droplet is a virtual machine typically running a UNIX system. Basically if you are looking for a service where you can both host a website and do some development, Digital Ocean may be the way to go, but it is not free. But yes, you would have to configure everything yourself with regards to setting-up Django, proxies, and other network-related tasks.
If you are looking for an easier, alternative solution, you might want to take a look at Django on Heroku.
As far as I know, there are no one-click solutions for Django. There is an official tutorial, though, which is where I would start, along with a quick read in the Django docs.
My experience hosting small Django apps on DO has generally been good. DO is very stable nowadays with no noticeable downtime (unless you must guarantee HA to your users, which I don't).
I have been using Digital Ocean/DO for my Django deployment last 6 months and have a great experience.
I use Django On Click Django 1.8.7 in Ubuntu 16.04 Image for all my website development.
Do provides extensive tutorials/documentations and very developer/tinker friendly. I was able to config my Do box Nginx to host 4 different websites on one single box and even manage to run a Ethereum node on it.
I wrote this tutorial on How to Deploy Multiple Websites on 1 single DO Droplets - Tutorial Link

trying to setup TinyWebDB on google cloud, but deploy not working

I am trying to follow the instructions on this page, and they are working great, until the part where I deploy from my Google App Engine Launcher. When I click deploy I should see something like this:
But instead, I see something like this:
and the end result is that my app doesn't get deployed to xxxxxxx.appspot.com, it redirects me to http://localhost:8080/?code=4/EfmizPdAPVDgoSInA8mS1KVOvQTkWX4ziFnEpG3XKxA#
I'm a begginer with this kind of tech, please, any suggestions on how to troubleshoot?
Found the answer here. In my case, what worked was to first disable the app in the App Engine Launcher, and only then hit deploy. First time I tried, it authenticated, then second time I deployed, it deployed successfully. Thanks Arnie.
In case, I post his other suggestions:
1) remember to give your google id access to less secure apps.
2) remember to go to appspot.com or https://appengine.google.com/ and accept terms and conditions. Your project should also be active on https://console.developers.google.com/project
3) use correct versions of python and google app engine SDK
4) Before hitting deploy button on google app engine stop the app from running on your local host. It will NOT deploy while it is running locally on local host.

Deploy Django project on Google App Engine

I have developed one example project in django1.4 & python 2.7, I want to deploy it on google app engine,
but how to configure my project as per App Engine we didn't get.
We have a site running on google app engine, but it is including with all html,js.
How do we configure a database on google app engine to deploy our django project?
Possibly the best option is to use Django Non-Rel. It's the only way (that I know of) to use the Django ORM (the django database interface) on Google App Engine without using Google's costly cloud SQL service. To do this, you'll need to use a customized version of Django and import several more libraries. It's a small project to get it up and running, but it's worth the effort. More information can be found on this website:
http://django-nonrel.org/
Note, that even though django-nonrel allows you to use the Django database interface, it will not allow you to use certain SQL features, such as joins. If you need joins, then your best option would be to use Google App Engine + Google Cloud SQL. Documentation for that is here.
Regarding the comments:
Yes, it can run on windows, I run it on Windows.
Also, the site allbuttonspressed.com is old and out of date, use the
one above for information.

porting django app to GoogleAppEngine to deploy on appspot.com

I wanted to port my django app to run on GoogleAppEngine and deploy this on appspot.com.In my django app I am using postgres as db to store user info,sothat user login /registration is possible.
I came across this article about porting django to appengine.
It mentions that you need to use Google Cloud SQL backend .This article says that it comes with a price from june12th onwards.
So,it seems that, to I have to pay to deploy even a non commercial application? Or is there some way I can do this without using cloud sql?
I did it with django-nonrel, it requires a few modifications but it worked. Here is a guide on how to set up. After it worked for me, I realized Heroku was easier to set-up and maintain, so my other apps went straight to heroku.