my app.yaml:
handlers:
- url: /static
static_dir: static
- url: /.*
script: main.app
is there a way, inside my webapp2 code, to get the absolute URL of the /static route?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When you define routes in your application you can compute an uri. See: http://webapp-improved.appspot.com/guide/routing.html#building-uris
With this information and your knowledge of the app.yaml you can compute the uri for the static url.
In your main.app you add a dummy route definition for static. It will only be used to build the uri and it will never be used for routing.
Modified example from the webapp2 docs :