python - 如何修复“警告:不要在生产环境中使用开发服务器。”
问题描述
当我尝试在 Spyder (python2.7) 中运行代码时,它立即告诉我:
runfile('hereisthefilepath',wdir='path')
Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
Debug mode: off
Running on http://127.0.0.1:8050/ (Press CTRL+C to quit)
我将发布我的代码的开始,我认为问题是因为我连接到错误的环境,我应该在开发环境中。
我已经尝试过以下代码:
export FLASK_APP=yourapp
export FLASK_ENV=development
flash run
但是 Spyder (python2.7) 说“Flask_APP”和“ENV”有语法错误
这是我的代码:
import pandas as pd
import numpy as np
import pyodbc
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output, State
import dash
currconn = pyodbc.connect('Driver={SQL Server};Server=xxxx-dbs-xx.xx.xxxx.ca;Database=Anexample;UID=xx_xxxx;PWD=xxxxxxxxxxx')
currquery = "SELECT DISTINCT country FROM dbo.vw_regions"
currcursor = currconn.cursor()
currcursor.execute(currquery)
任何人都可以帮助我吗?出现此错误,我无法运行任何东西。
解决方案
推荐阅读
- excel - X和Y坐标到纬度和经度的公式?
- python - BeautifulSoup4 中的文本丢失
- docker - 如何将 /etc/resolv.conf 修改为 docker 文件中的非 root 用户或脚本
- android - textView 中的 Ellipsize - 点与 textView 高度的中心对齐
- terraform - 在执行开始和结束时强制资源?
- node.js - (错误)使用串行端口时通过套接字向客户端发送多条消息
- javascript - 在混合移动应用程序中使用 VueJs 实现 google 地方
- html - 为什么十进制不预填充而整数呢?
- css - Vue datetimepicker - 月视图仅显示 1 行
- javascript - 无法导航到 href,url 只是丢失了参数