I've set Django up on app engine a few times and every time it's a massive
struggle.

App engine wasn't really designed to work well with Cloud SQL as it's not a
dynamically scalable data store, it is expected that you use google
datastore (or firestore nowadays) - which isn't ideal for django as it is
non-relational.

To remedy this App Engine has been made so that it can to the Cloud SQL
instances through a proxy. But documentation on this is poor and setting up
the right environment to use this proxy feels arbitrary. There are a
several magic env vars and similar configuration options that need to be
put in to enable access.

It's been well over a year since I last did this but most times it's
involved following multiple guides to eventually get to the truth on it.
The Python 3 app engine guide when it was first released completely ignored
these steps and so was essentially broken when it came to DB setup (I get
the feeling it still is).

https://cloud.google.com/sql/docs/mysql/connect-app-engine#connecting_to
definitely hints at some of the issues. The Python 2 guide for Django did
have some guidance on it as well if you can find that. But the key thing is
that, as App Engine IPs are arbitrary, you cannot connect directly to the
database but need to tell App Engine to load up a proxy and then connect to
that instead.

Sorry I can't help much more - I wish I'd written down the steps I took
last I did this, but it's been too long for me to remember it well.

- Nick


On Wed, Apr 22, 2020 at 2:14 PM Anirudh choudhary <
anirudhchoudary...@gmail.com> wrote:

> hi to all! I am hosting my blogging app on google app engine in a standard
> environment. the website deploys successfully. but when I try to go to any
> other URL like anirudhmalik.in to anirudhmalik/blog/list/ it shows me 500
> server error on the server side I am using PostgreSQL instance and the logs
> message only show me the error
> projects/anirudhmalik-274008/logs/appengine.googleapis.com%2Frequest_log"
>
> but I couldn't get any hint from this message and none of the post
> requests is
> working on the website and everything is working fine in a local server or
> my local machine
>
> you can check the website on anirudhmalik.in
>
> and you can also give suggestion is google app engine is good to host your
> Django project
> and other cheap college student type hosting service
> thankyou
>
>
> main.py
>
> from annyportfolio.wsgi import application
>
> app=application
>
> app.yaml file
>
> runtime: python37
>
> handlers:
> # This configures Google App Engine to serve the files in the app's static
> # directory.
> - url: /static
> static_dir: static-storage/
>
>
> # This handler routes all requests not caught above to your main app. It is
> # required when static routes are defined, but can be omitted (along with
> # the entire handlers section) when there are no static files defined.
>
> - url: /.*
> secure: always
> redirect_http_response_code: 301
> script: auto
>
>
>
> env_variables:
> DJANGO_SETTINGS_MODULE: annyportfolio.settings
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAL8_rkG8qwM491qCcX18qgukA_ao4_ZjH8%2B-K01m17vOTcTTNw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAL8_rkG8qwM491qCcX18qgukA_ao4_ZjH8%2B-K01m17vOTcTTNw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAGuvt90e1_JsC_D0A_CpAvaL0sfZYMCMaJcv9Tyhi2k7Bi%3DHDg%40mail.gmail.com.

Reply via email to