PHP has $_SERVER['DOCUMENT_ROOT'] as a reference to the base url of a website: e.g. http://localhost:8080/. I need to do the same in jinja2. I am using python 2.7 on app engine.
How do I get the base url of website in jinja2?
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.
In webapp2, you can get the host part of a request and pass it as argument in a jinja template as follows: