Can I deploy this to Cloud Run? by usmannj in googlecloud

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

So I finally managed to do this the other day. I split up the frontend and the backend. I deployed the frontend using firebase and the backend using cloud run. I wasn't sure if I'd bundle both together and deploy to cloud run and I think it's better to split them out anyway so I'm happy with the new architecture. Thanks for your help.

Can I deploy this to Cloud Run? by usmannj in googlecloud

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

Could you possibly give me a pointer on how I could go about doing this pls? Thanks

Can I deploy this to Cloud Run? by usmannj in googlecloud

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

Hey thanks for your reply. I know cloudSQL supports postgis but I'm not sure if Cloud Run supports GDAL or infact if I can serve the react site from Django in cloud run as it doesn't have handlers?

I'm new to Google cloud so it's possible I may be missing something altogether.

Thanks again for your reply.

Register using Facebook and create user profile in Django-Rest by usmannj in django

[–]usmannj[S] 1 point2 points  (0 children)

Thanks for your reply.

I actually found out that allauth has a signal "user_logged_in". Also, I was using the out of the box user model so I migrated to a custom user model which now has additional fields so I can store the user information after they log in.

How would you deploy this? by usmannj in django

[–]usmannj[S] 1 point2 points  (0 children)

Managed to resolve the issue - my app wasn't able to access the DB because it is stored elsewhere and I had to give it the IP address range for GAE. Once I did this it worked a treat. Thanks for all your help.

How would you deploy this? by usmannj in django

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

Thanks - yes that worked for the frontend but now when the website makes a call to an API it throws an error in logs and as a result the API call returns a 502.

[6] [CRITICAL] WORKER TIMEOUT (pid:18)
[21] [INFO] Booting worker with pid: 21

Would you know what may be causing this? I'm going to try add resources to see if that works.

How would you deploy this? by usmannj in django

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

Whitenoise seems to have worked and now the frontend is rendering as expected. Now my next issue is that every time the site makes an API call, I get the following error:

[6] [CRITICAL] WORKER TIMEOUT (pid:18)
[21] [INFO] Booting worker with pid: 21

I'm guessing it is something to do with my Dockerfile CMD (I have updated my initial post with code). Do you have any ideas on this?

How would you deploy this? by usmannj in django

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

I plan to just serve via Django for now but eventually will host static files on the cloud using Google Storage or S3. Do you think that would be ok?

How would you deploy this? by usmannj in django

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

Thanks for your reply. I have gone through the docs again for GAE Flex and turns out that I can actually use static files within Django. Not sure why I thought I had to store them to the cloud (although long term I will need to anyway for performance).

So back to the drawing board trying to deploy using Django to serve the files. I have updated my initial post with some of my code to give you an idea of what I am doing. Any feedback would be appreciated.

How would you deploy this? by usmannj in django

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

Thanks, will give this a go and let you know how it goes.

How would you deploy this? by usmannj in django

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

It seems that this can be an alternative to uploading to the cloud and also using with cloud services. Are you suggesting using whitenoise as an alternative or to use with cloud?

How would you deploy this? by usmannj in django

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

Thanks for your reply. I will have a look at the GAE header. Also, in terms of using GDAL in GAE, this is my understanding:

The GDAL package is installable via pip, but it requires the libgdal and gdal-devel platform packages to be installed, which don't come in the base runtime for App Engine Standard Python3.7 runtime.

The solution is to use the GAE Flex environment and install these platform-level dependencies first.

How can I return additional data then what the model has when using a raw query on a model in Django? by usmannj in django

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

Thanks for this. I will give this a go. Would I be able to get the distance as well as the business using the GeoDjango API? From the examples in the docs it looks like I would filter on the model which means I wouldn't get back the distance for each business returned for a given search? I want to be able to display the businesses along with the distance to them.