1

I plan to switch from a single app on a project to multiple apps on a project. One being the current non-UI app and one will be based on Django. I'm writing the code in Python2.7

I saw google example of app.yaml, but there is no examples for 2 or more apps. There is already a similar question. but still with no example (Run Google App Engine application with microservice)

How do i call Django microservice/module and how do i call the other app (microservice/module)?

My current structure is:

main_app directory
- dj (django app)
-- dj.yaml
-- manage.py
-- __init__.py (empty)
-- polls (from django tutorial)
-- mysite (from django tutorial)
- otherapp
-- otherapp.yaml
-- something.py
- app.yaml
- cron.yaml

Here is a part of my app.yaml (that should control both apps):

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /.*
  script: main.app
- url: /uploadcsv/.*
  script: main.app


libraries:
- name: MySQLdb
  version: "latest"
Community
  • 1
  • 1
Yarh
  • 895
  • 7
  • 15
  • not sure what examples you're looking for. mentioned question have very detailed answer (and also read comments to the question itself) – Igor Artamonov Jul 19 '16 at 18:43
  • 2
    Possible duplicate of [Run Google App Engine application with microservice](http://stackoverflow.com/questions/38125926/run-google-app-engine-application-with-microservice) – Igor Artamonov Jul 19 '16 at 18:44
  • The Q&A mentioned in the one indicated by Igor has some examples, as mentioned. That is assuming by "multiple apps" you really mean "multiple services/modules inside the same GAE app", of course, otherwise the standard note that splitting an app into multiple ones can be viewed as an attempt to multiply the free quota which is a breach of the GAE terms of service (plus it involves unnecessary complications for communication between those apps) – Dan Cornilescu Jul 19 '16 at 21:26
  • I edited my question with my files examples. Can you comment on that? – Yarh Jul 20 '16 at 15:22
  • "app.yaml (that should control both apps)" - wrong assumption, each module/service `.yaml` file only controls **that particular** module/service. More here: http://stackoverflow.com/questions/38125926/run-google-app-engine-application-with-microservice. – Dan Cornilescu Jul 20 '16 at 16:41
  • BTW - stop using the "apps" term for these GAE microservices - you'll confuse both yourself and the others. They used to be called `modules` (and you'll still find plenty of such references in Google docs, SO, etc) and now Google is (gradually) switching to `services` instead. – Dan Cornilescu Jul 20 '16 at 16:41
  • ok, so what should i put in app.yaml that will redirect traffic to Django or other module/services. – Yarh Jul 20 '16 at 17:47
  • Routing requests information is not put in the app.yaml, it's in dispatch.yaml https://cloud.google.com/appengine/docs/python/how-requests-are-routed – marcadian Jul 21 '16 at 02:50

1 Answers1

1

You cannot have 2 or more apps in a single App Engine project but you can have 2 or more modules/services within a single App Engine app. See here for details:

https://cloud.google.com/appengine/docs/python/modules/converting

Mete Atamel
  • 821
  • 5
  • 11