@@ -29,7 +29,7 @@ Note: setting allowed networks to 0.0.0.0/0 opens your SQL instance to traffic f
2929* Alternatively, the instance can be created with the gcloud command line tool as follows, substituting `your-root-pw
3030 with a strong, unique password.
3131
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
3333
3434* Create a Database And User
3535
@@ -51,23 +51,21 @@ First make sure you have Django installed. It's recommended you do so in a
5151[ virtualenv] ( https://virtualenv.pypa.io/en/latest/ ) . The requirements.txt
5252contains just the Django dependency.
5353
54- ` pip install -r requirements.txt `
54+ pip install -r requirements.txt
5555
5656Once the database is setup, run the migrations.
5757
58- ` python manage.py migrate `
58+ python manage.py migrate
5959
6060If you'd like to use the admin console, create a superuser.
6161
62- ` python manage.py createsuperuser `
62+ python manage.py createsuperuser
6363
6464The app can be run locally the same way as any other Django app.
6565
66- ` python manage.py runserver `
66+ python manage.py runserver
6767
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
7169
7270## Deploying
7371
@@ -76,33 +74,31 @@ the static content is instead served from Google Cloud Storage.
7674
7775First, make a bucket and make it publically readable, replacing <your-gcs-bucket > with a bucket name, such as your project id:
7876
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>
8179
8280Next, gather all the static content locally into one folder using the Django ` collectstatic ` command
8381
84- ` python manage.py collectstatic`
82+ python manage.py collectstatic
8583
8684Then upload it to CloudStorage using the ` gsutil rsync ` command
8785
88- ` gsutil rsync -R static/ gs://<your-gcs-bucket>/static`
86+ gsutil rsync -R static/ gs://<your-gcs-bucket>/static
8987
9088Now your static content can be served from the following URL:
9189
92- ` http://storage.googleapis.com/<your-gcs-bucket/static/`
90+ http://storage.googleapis.com/<your-gcs-bucket/static/
9391
9492Make sure to replace <your-cloud-bucket > within ` mysite/settings.py ` to set STATIC_URL to the correct value to serve static content from, and
9593uncomment the STATIC_URL to point to the new URL.
9694
9795The app can be deployed by running
9896
99- ` gcloud preview app deploy app.yaml --set-default --version=1 --promote`
97+ gcloud app deploy
10098
10199which deploys to version 1, and ` promote ` makes version 1 the default version.
102100
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.
106102
107103## Contributing changes
108104
0 commit comments