[英]Jinja 2 markups showing when i try to use apache with a flask python coded webpage
The website is accessible by other computers by inputting the ip address of the host computer. 通过输入主机的IP地址,其他计算机可以访问该网站。 However, the jinja2 markups are shown. 但是,显示了jinja2标记。 Jinja2 markups image Jinja2标记图片
And the links which use url_for do not work either. 并且使用url_for的链接也不起作用。 Non-working url image 无效的网址图片
What is the issue here? 这是什么问题? Please help! 请帮忙! Thanks! 谢谢!
flask / jinja is not a "server page" type of technology like PHP, so jinja templates (which by themselves know nothing about flask - jinja can be used from any Python code) won't be automagically "interpreted". flask / jinja不是像PHP这样的“服务器页面”技术,因此不会自动“解释” jinja模板(它们本身对flask不了解-jinja可以从任何Python代码中使用)。 You have to configure your apache server to serve content from flask as documented here : http://flask.pocoo.org/docs/deploying/mod_wsgi/ 您必须配置apache服务器,以按照以下文档中的说明从flask提供内容: http : //flask.pocoo.org/docs/deploying/mod_wsgi/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.