问题描述
我在尝试将Flask应用程序作为服务时遇到问题,这是我的文件:
api.py
import java.util.*;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(system.in);
int t = sc.nextInt();
while(t-->0){
int n = sc.nextInt();
int ar[] = new int[n];
for(int i = 0;i<n;i++)
ar[i] = sc.nextInt();;
Arrays.sort(ar,new Comparator<Integer>(){
public int compare(int a,int b){
return Math.abs(b)-Math.abs(a);
}
});
}
}
}
应用服务
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!\n'
if __name__ == "__main__":
app.run()
uwsgi.ini
[Unit]
Description=uWsgi instance to serve app
[Service]
ExecStart=/bin/bash -c 'source /home/uvgadming/anaconda3/bin/activate olxproject && uwsgi --ini /home/uvgadming/UVGProject/ScrappingProject/flask/uwsgi.ini'
[Install]
WantedBy=multi-user.target
api.py和uwsgi在同一目录中。当我尝试使用systemctl启动服务时,我得到:
[uwsgi]
http = localhost:5000
wsgi-file = api.py
callable = app
能帮我解决一下吗?我已经尝试了很多东西。
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)