Running Django in the App Engine Flexible Environment

77 views
Skip to first unread message

Dentals Canada

unread,
Jan 4, 2018, 6:32:50 PM1/4/18
to Google App Engine

i was following the whole procedure from here using windows:
https://cloud.google.com/python/django/flexible-environment

1.step Download and run the app
using sdk commandline i did
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
cd python-docs-samples\appengine/flexible\django_cloudsql


my current directory is C:\Users\vibe\AppData\Local\Google\Cloud SDK\python-docs-samples\appengine\flexible\django_cloudsql


2.
Setting up your local environment

using sdk commandline i did
gcloud auth application-default login (authentication)

downloaded
cloud_sql_proxy.exe in C:\Users\vibe\AppData\Local\Google\Cloud SDK\python-docs-samples\appengine\flexible\django_cloudsql this directory

gcloud sql instances describe [YOUR_INSTANCE_NAME]

cloud_sql_proxy.exe -instances="[YOUR_INSTANCE_CONNECTION_NAME]"=tcp:5432

3.Configure the database settings

i  edited

 mysite/settings.py

gcloud beta sql instances describe [YOUR_INSTANCE_NAME]

4.
Run the app on your local computer
i did

virtualenv env
env
\scripts\activate
pip install
-r requirements.txt

But when i did python manage.py makemigration



Its showing this error:


could not connect to server: Connection refused Is the server running on hostlocalhost” (127.0.0.1) and accepting TCP/IP connections on port 5432?


























Can anyone please advise on how I can resolve this issue?

Thanks!




Jordan (Cloud Platform Support)

unread,
Jan 5, 2018, 4:39:01 PM1/5/18
to Google App Engine
Make sure that you have setup the Python Development Environment first before attempting to run the application locally. You should also try following the entire tutorial via the Google Cloud Shell instead of your local machine, as this will remove any possible issues with your local system. 

- Note that Google Groups is meant for general product discussions and not for technical support. If you require further technical support for connecting your local test application running in the virtual environment to your Cloud SQL instance via the Cloud SQL proxy, it is recommended to post your detailed questions on Stack Overflow using the supported Cloud tags, as technical support monitors questions there.
Reply all
Reply to author
Forward
0 new messages