Making GCP bucket default storage in Django - python

I am not using App Engine.
I have deployed my Django server in my GCP instance and using Django root location for the storage. However, I want to access the GCP bucket and make it as the default storage location for uploading and sending the path to the function used in the views.py
Here's a link Configure Django and Google Cloud Storage?
From the URL above, I think that the issue can be solved but I'm unable to understand where to deploy the code: settings.py or views.py?
Is it possible that someone can help me with steps?

Related

Setting django to server media files from google cloud

I'm trying to deploy my project in Heroku but the media files (images) are deleted , so someone told me that i need to use a service called "Google cloud", my question is, how to configure my prject to use that service. Can somebody help me?
You can also use Amazon web services S3 buckets here is a link:
Link to guide on how to serve media and static files from AWS S3 to a Django app deployed on heroku

Deploying Django to Google cloud platform

I'm working on a project which is a django backend application , the application at some point relies on the file system to read and write videos and also load tensorflow models.
Is it possible to use google app engine to run my django app or do I need to rent a VM ?
Thanks
Yes, it is possible to run your Django App on App Engine.
You cannot write to App Engine file system but you can read files from your own project.
A possible solution would be to use Cloud Storage to read and write videos and load tesorflow models.
Reading and Writing to Google Cloud Storage
How to restore Tensorflow model from Google bucket without writing to filesystem?
Yes, you can run Django on App Engine, see https://cloud.google.com/python/django/appengine for more details.
There are other options as well for running Django on Google Cloud, see https://cloud.google.com/python/django/ for a complete list.

How can I edit the NGINX configuration on Google App Engine flexible environment?

How can I edit the Google App Engine NGINX configuration?
There doesn't seem to be much support in the Google docs in regards to the NGINX configuration for apps running in the Google App Engine flexible environment.
My app is running fine, but I get this 413 error when I try and upload an audio file (.wav or .mp3).
413 Request Entity Too Large -- nginx
My app is running Django (python 3), with Cloud Postgres SQL and Cloud Storage enabled.
I researched the error, and it seems I can set a nginx.config file so that it includes "client_max_body_size 80M" - but like I said, there is no documentation regarding how to manually config NGINX on deploy.
Any suggestions?
You should be able to create a nginx-app.conf file in the same directory as your app.yaml file. There is an example of using the nginx configuration file in a Flex environment located here: https://github.com/GoogleCloudPlatform/getting-started-php/tree/master/4-auth .
This same file is referenced in Google's documentation here: https://cloud.google.com/appengine/docs/flexible/php/runtime#customizing_nginx
Once you have that file created, you should be able to add any property you need and then rebuild your project to see the changes take effect.
So upon contacting Google Support, the suggested solution for uploading files larger than 32MB is as follows:
"The way to circumvent App Engine's 32MB limit is to send the requests directly to Cloud Storage, for instance using the resumable upload process. You can still use App Engine to serve your app, but the clientside portion of the app would be the one handling the upload to Google Cloud Storage. For this you would have your application generate a signed URL which the client can use to gain access to your Cloud Storage bucket for the purpose of uploading an image."
I went with this solution. It saves money in the end.

Accessing Google Groups Services on Google Apps Script in Google App Engine?

I'm trying to work out if it is possible to use Google Apps Scripts inside Google App Engine?
And if there is a tutorial in doing this out there ?
Through reading Google's App Script site I get the feeling that you can only use app scripts inside Google Apps like Drive, Docs etc?
What I would like to do is to be able to use the Groups Service that is in GAS inside GAE to Create, delete and only show the groups that a person is in, all inside my GAE App.
Thanks
No you can't. AS and GAE are totally different things and won't work together.
What you can really do is (abstract):
write an AS that does what you need
redirect from GAE to the AS url to make sure that the user logs-in/grants permissions.
perform what you needed to do with AS
send back the user to GAE with a bunch of parameters if you need to
If you need GAE in Google Apps script, you can write a webservice in GAE using UrlFetch in Apps Script: https://developers.google.com/apps-script/service_urlfetch
To give you an example: I created an Apps Script to get report data (json) from an appengine webservice. This data is added to a google apps spreadsheet.

Will app engine python automatically upload local datastore to serve after deploying?

Using python app engine, I have some data on local datastore. Will the local datastore be uploaded to app engine server after deploy? If not, how can I upload them to the server in the easiest way?
No, it will not be automatically uploaded.
See the Uploading and Downloading Data page on the AppEngine docs for details on how to best upload bulk data to your app.

Categories