hosting django app on app engine

34 views
Skip to first unread message

Anirudh choudhary

unread,
Apr 22, 2020, 9:16:29 AM4/22/20
to django...@googlegroups.com
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



VenkataSivaRamiReddy

unread,
Apr 22, 2020, 2:48:32 PM4/22/20
to django...@googlegroups.com
Hi can you share any reference link. I am looking for deploy my djanago application but I don't know how to deploy

--
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...@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.

Aldian Fazrihady

unread,
Apr 22, 2020, 5:03:25 PM4/22/20
to django...@googlegroups.com

--
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...@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.


--
Regards,

Anirudh choudhary

unread,
Apr 23, 2020, 2:50:00 AM4/23/20
to django...@googlegroups.com
You can host your website on Google vm  instance , heroku or python anywhere  
For hosting on heroku try :- 

For hosting on pythonanywhere .com 
Try any tutorial from.youtube 

Nick Sarbicki

unread,
Apr 23, 2020, 6:44:48 AM4/23/20
to Django users
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


Reply all
Reply to author
Forward
0 new messages