Flask 搭建碰到的问题

上一篇 / 下一篇  2019-02-14 09:33:37 / 个人分类:Flask

一、 demo启动后,没有报错,但是网页端报Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
解决方法1:
排查是否端口被占用了。
windows操作步骤
1.输入cmd打开命令窗口
2.输入命令:netstat -ano 查看所有的进程,如有进程占用着,则进操作第三步
3.输入命令:taskkill /f /t /im 进程id (/f /t /im 中间是有空格的)

二、连接数据库时报ModuleNotFoundError: No module named 'MySQLdb'错误
解决方法:
只要在配置SQLALCHEMY_DATABASE_URI时,加上一个pymysql就可以了:
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:password@localhost/你的数据库名'
,当然,前提是要已经安装了pymysql,如果没有装pymysql,是会报ModuleNotFoundError: No module named 'pymysql'错误的,安装命令也很简单:python -m pip install pymysql

三、web页面显示 Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

TAG:

 

评分:0

我来说两句

我的栏目

日历

« 2024-03-14  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 1917
  • 日志数: 3
  • 建立时间: 2019-02-14
  • 更新时间: 2019-03-14

RSS订阅

Open Toolbar