App Dev: Storing Application Data in Cloud Datastore - Python || Arcade Level 1 #qwiklabs || #GSP184

preview_player
Показать описание
App Dev: Storing Application Data in Cloud Datastore - Python || Arcade Level 1 || Lab Solution || Qwiklabs Arcade 2024 #qwiklabs | #gsp184

Hey guys in this video I am going to explain you about Google Cloud Qwiklabs Arcade Lab Solution. If you like the video and want more content like this then don't forget to subscribe us.

#googlecloud #googlecloudreadyfacilitatorprogram #google #qwiklab #swags #googlecloud2022 #triviaaugustweek4

**The Level 1: Application Development and Deployment Labs Links:- **

PART - A { Dev Delight! }
6.
7.

PART - {JOY}

Query Solved:-
google cloud ready facilitator program 2023 solutions
qwiklabs
arcade facilitator
google cloud arcade facilitator program 2023
google cloud arcade facilitator program
google arcade qwiklabs
qwiklabs arcade event
google cloud ready facilitator program
qwiklabs arcade 2023
google cloud ready facilitator program swags
google cloud ready facilitator program unboxing
google cloud ready facilitator program 2023 swags
qwiklabs arcade
arcade qwiklabs 2023

#qwiklabs
#goodies
#swags
#google
#arcade
#schwags
#youtube
#youtubechannel
#google
#gcrf
#googlecloud
#qwiklab
#qwiklabsarcade2023
Рекомендации по теме
Комментарии
Автор

export REGION=


gcloud auth list

virtualenv -p python3 vrenv

source vrenv/bin/activate


cd

export

pip install -r requirements.txt

gcloud app create --region "$REGION"

cd quiz/gcp


cat > datastore.py <<EOF_END
# TODO: Import the os module

import os

# END TODO

# TODO: Get the GCLOUD_PROJECT environment variable

project_id = os.getenv('GCLOUD_PROJECT')

# END TODO

from flask import current_app

# TODO: Import the datastore module from the google.cloud package

from google.cloud import datastore

# END TODO

# TODO: Create a Cloud Datastore client object
# The datastore client object requires the Project ID.
# Pass through the Project ID you looked up from the
# environment variable earlier

datastore_client = datastore.Client(project_id)

# END TODO

"""
Create and persist and entity for each question
The Datastore key is the equivalent of a primary key in a relational database.
There are two main ways of writing a key:
1. Specify the kind, and let Datastore generate a unique numeric id
2. Specify the kind and a unique string id
"""
def save_question(question):
# TODO: Create a key for a Datastore entity
# whose kind is Question

key =

# END TODO

# TODO: Create a Datastore entity object using the key

q_entity = datastore.Entity(key=key)

# END TODO

# TODO: Iterate over the form values supplied to the function

for q_prop, q_val in question.items():

# END TODO

# TODO: Assign each key and value to the Datastore entity

q_entity[q_prop] = q_val

# END TODO

# TODO: Save the entity



# END TODO
EOF_END

cd


python run_server.py

TheSilentCoder-wc
join shbcf.ru