1

If I have a static website site on app engine (within a python runtime), if I want to make a jQuery AJAX call to a single python script to fetch something, do I have to put the whole site in a python framework just to run that file?

Using app engine standard.

1 Answer 1

3

No. Just specify in your app.yaml a path that should be routed to a python app, and leave the rest of the paths mapped to your static site.

For example:

handlers:
- url: /your/ajax/call
  script: yourmodule.yourapp

- url: /(.*)
  static_files: static/\1
  upload: static/.*

Handlers are evaluated for matches in the order they're specified, so your ajax call will match its specific path, and the static handler will match anything else.

https://cloud.google.com/appengine/docs/standard/python/config/appref

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.