| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f8d91a4 commit 48a09ca
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,7 +54,7 @@ Some samples in this repositories may have special deployment instructions. Refe | |||
| 54 | 54 | 3. Use gcloud to deploy your app. | |
| 55 | 55 | ||
| 56 | 56 | ``` | |
| 57 | - gcloud preview app deploy app.yaml | ||
| 57 | + gcloud app deploy | ||
| 58 | 58 | ``` | |
| 59 | 59 | ||
| 60 | 60 | 4. Congratulations! Your application is now live at `your-app-id.appspot.com` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,7 @@ Note: setting allowed networks to 0.0.0.0/0 opens your SQL instance to traffic f | |||
| 29 | 29 | * Alternatively, the instance can be created with the gcloud command line tool as follows, substituting `your-root-pw | |
| 30 | 30 | with a strong, unique password. | |
| 31 | 31 | ||
| 32 | - `gcloud sql instances create <instance_name> --assign-ip --authorized-networks=0.0.0.0/0 set-root-password=your-root-pw` | ||
| 32 | + gcloud sql instances create <instance_name> --assign-ip --authorized-networks=0.0.0.0/0 set-root-password=your-root-pw | ||
| 33 | 33 | ||
| 34 | 34 | * Create a Database And User | |
| 35 | 35 | ||
@@ -51,23 +51,21 @@ First make sure you have Django installed. It's recommended you do so in a | |||
| 51 | 51 | [virtualenv](https://virtualenv.pypa.io/en/latest/). The requirements.txt | |
| 52 | 52 | contains just the Django dependency. | |
| 53 | 53 | ||
| 54 | - `pip install -r requirements.txt` | ||
| 54 | + pip install -r requirements.txt | ||
| 55 | 55 | ||
| 56 | 56 | Once the database is setup, run the migrations. | |
| 57 | 57 | ||
| 58 | - `python manage.py migrate` | ||
| 58 | + python manage.py migrate | ||
| 59 | 59 | ||
| 60 | 60 | If you'd like to use the admin console, create a superuser. | |
| 61 | 61 | ||
| 62 | - `python manage.py createsuperuser` | ||
| 62 | + python manage.py createsuperuser | ||
| 63 | 63 | ||
| 64 | 64 | The app can be run locally the same way as any other Django app. | |
| 65 | 65 | ||
| 66 | - `python manage.py runserver` | ||
| 66 | + python manage.py runserver | ||
| 67 | 67 | ||
| 68 | - Now you can view the admin panel of your local site at | ||
| 69 | - | ||
| 70 | - `http://localhost:8080/admin` | ||
| 68 | + Now you can view the admin panel of your local site at http://localhost:8080/admin | ||
| 71 | 69 | ||
| 72 | 70 | ## Deploying | |
| 73 | 71 | ||
@@ -76,33 +74,31 @@ the static content is instead served from Google Cloud Storage. | |||
| 76 | 74 | ||
| 77 | 75 | First, make a bucket and make it publically readable, replacing <your-gcs-bucket> with a bucket name, such as your project id: | |
| 78 | 76 | ||
| 79 | - `gsutil mb gs://<your-gcs-bucket>` | ||
| 80 | - `gsutil defacl set public-read gs://<your-gcs-bucket>` | ||
| 77 | + gsutil mb gs://<your-gcs-bucket> | ||
| 78 | + gsutil defacl set public-read gs://<your-gcs-bucket> | ||
| 81 | 79 | ||
| 82 | 80 | Next, gather all the static content locally into one folder using the Django `collectstatic` command | |
| 83 | 81 | ||
| 84 | - `python manage.py collectstatic` | ||
| 82 | + python manage.py collectstatic | ||
| 85 | 83 | ||
| 86 | 84 | Then upload it to CloudStorage using the `gsutil rsync` command | |
| 87 | 85 | ||
| 88 | - `gsutil rsync -R static/ gs://<your-gcs-bucket>/static` | ||
| 86 | + gsutil rsync -R static/ gs://<your-gcs-bucket>/static | ||
| 89 | 87 | ||
| 90 | 88 | Now your static content can be served from the following URL: | |
| 91 | 89 | ||
| 92 | - `http://storage.googleapis.com/<your-gcs-bucket/static/` | ||
| 90 | + http://storage.googleapis.com/<your-gcs-bucket/static/ | ||
| 93 | 91 | ||
| 94 | 92 | Make sure to replace <your-cloud-bucket> within `mysite/settings.py` to set STATIC_URL to the correct value to serve static content from, and | |
| 95 | 93 | uncomment the STATIC_URL to point to the new URL. | |
| 96 | 94 | ||
| 97 | 95 | The app can be deployed by running | |
| 98 | 96 | ||
| 99 | - `gcloud preview app deploy app.yaml --set-default --version=1 --promote` | ||
| 97 | + gcloud app deploy | ||
| 100 | 98 | ||
| 101 | 99 | which deploys to version 1, and `promote` makes version 1 the default version. | |
| 102 | 100 | ||
| 103 | - Now you can view the admin panel of your deployed site at | ||
| 104 | - | ||
| 105 | - `https://<your-app-id>.appspot.com/admin` | ||
| 101 | + Now you can view the admin panel of your deployed site at https://<your-app-id>.appspot.com/admin. | ||
| 106 | 102 | ||
| 107 | 103 | ## Contributing changes | |
| 108 | 104 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,7 @@ Open the `swagger.yaml` file and in the `host` property, replace | |||
| 40 | 40 | ||
| 41 | 41 | Then, deploy the sample using `gcloud`: | |
| 42 | 42 | ||
| 43 | - gcloud preview app deploy app.yaml | ||
| 43 | + gcloud app deploy | ||
| 44 | 44 | ||
| 45 | 45 | Once deployed, you can access the application at https://YOUR-PROJECT-ID.appspot.com/. | |
| 46 | 46 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,4 +14,4 @@ This sample demonstrates how to extend the [python-compat](https://cloud.google. | |||
| 14 | 14 | ||
| 15 | 15 | 3. Deploy the sample: | |
| 16 | 16 | ||
| 17 | - $ gcloud preview app deploy | ||
| 17 | + $ gcloud app deploy | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,4 +14,4 @@ This sample demonstrates using the [python-compat](https://cloud.google.com/appe | |||
| 14 | 14 | ||
| 15 | 15 | 3. Deploy the sample: | |
| 16 | 16 | ||
| 17 | - $ gcloud preview app deploy | ||
| 17 | + $ gcloud app deploy | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ gcloud alpha bigquery import \ | |||
| 38 | 38 | --schema-file bigquery/api/resources/schema.json | |
| 39 | 39 | ||
| 40 | 40 | echo "Creating datastore indexes." | |
| 41 | - gcloud preview app deploy -q datastore/api/index.yaml | ||
| 41 | + gcloud app deploy -q datastore/api/index.yaml | ||
| 42 | 42 | ||
| 43 | 43 | echo "Creating pubsub resources." | |
| 44 | 44 | gcloud alpha pubsub topics create gae-mvm-pubsub-topic | |
| Back | FazBrowse Home | New Git URL |
0 commit comments