简体   繁体   English

Jinja 2标记显示当我尝试将Apache与烧瓶python编码的网页一起使用时

[英]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.

相关问题 当我尝试使用 render_template 时,我的网页上没有任何显示 Flask - Nothing showing on my webpage when I try to use render_template Flask Flask模板:nginx缓存或提供在Jinja标记中调用的静态资产 - flask templates: nginx cache or serve static assets called in jinja markups Flask/Jinja:有没有办法在 Python 调用中使用 Jinja 变量作为参数名称? - Flask/Jinja: Is there a way to use a Jinja variable as a parameter name in a Python call? 当我尝试运行我的烧瓶/python 应用程序时,它给了我错误:A secret key is required to use CSRF - when I try to run my flask/python application it gives me the error: A secret key is required to use CSRF 什么时候应该使用python flask条件条件与jinja2 html模板条件条件? - When should you use python flask conditionals vs jinja2 html template conditionals? Python Flask,Jinja Global - Python Flask, Jinja Global Jinja、Flask 和 CanvasJS 未显示图表 - Graphs not showing with Jinja, Flask, and CanvasJS 如何在Flask-Jinja Python中使用列表中的列表 - How to use list in list with Flask-Jinja Python 在 flask Z45E959010CBEC742B865B68A40FDB3 中如何使用 python function? - How use python function in flask jinja2 template? 当我尝试在 python 上安装模块时,错误不断出现 - Error keeps on showing up when i try to install a module on python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM