运行我的烧瓶应用程序时出现错误
from flask import *
import json
class Server:
app = Flask(__name__)
def __init__(self, ip='', port=5000):
self.ip = ip
self.port = port
@app.route('/app/v1.0/<task>', methods=['GET'])
def get_task(self, task):
try:
return task
except Exception as e:
print(e)
abort(404)
def run(self):
self.app.run(debug=True)
if __name__ == "__main__":
server = Server()
server.run()
在浏览器中我转到127.0.0.1/app/v1.0/test(默认烧瓶设置)
<div *ngFor="let item of getItems();">
<div ngIf="fileExists(item.url); then example2 else example1"></div>
<ng-template #example1>
<ion-icon class="myicon" name="download" color="primary"></ion-icon>
</ng-template>
<ng-template #example2>
<ion-icon class="myicon" name="checkbox" color="secondary"></ion-icon>
</ng-template>
</div>
答案 0 :(得分:1)
Flask App不应嵌套在类中。我正在转向龙卷风,因为它更能满足我的需求。