no display name and no $DISPLAY environment variable ============================ @Neil's answer is one (perfectly valid!) way of doing it, but you can also simply call matplotlib.use('Agg') before importing matplotlib.pyplot, and then continue as no
客户端(浏览器)----> 前端页面-----> 后端处理数据,并把数据以 json 形式发送到前端 online_app.py from django.conf import settings from django.http import HttpResponse from django.conf.urls import url from django.views.decorators.http import require_POST # 目前的 API 视图只能用于接收 POST 请求