Giter Club home page Giter Club logo

flaskvue's Issues

通过token无法访问

curl -i -u eyJhbGciOiJIUzUxMiIsImlhdCI6MTU3NzYwMjQ4OCwiZXhwIjoxNTc3NjAzMDg4fQ.eyJpZCI6MX0.1Z8MtJ6qlvFFvRrLIjhchL7ipB6aJgAXOzLU3Ir94owEhtmNWEjglAZTbITpljEMS960jPGEaeS7ouE5tD76jQ -X GET -H "Content-Type: application/json" http://127.0.0.1:8000/api/login
Enter host password for user 'eyJhbGciOiJIUzUxMiIsImlhdCI6MTU3NzYwMjQ4OCwiZXhwIjoxNTc3NjAzMDg4fQ.eyJpZCI6MX0.1Z8MtJ6qlvFFvRrLIjhchL7ipB6aJgAXOzLU3Ir94owEhtmNWEjglAZTbITpljEMS960jPGEaeS7ouE5tD76jQ':
HTTP/1.0 401 UNAUTHORIZED
Content-Type: text/html; charset=utf-8
Content-Length: 19
WWW-Authenticate: Basic realm="Authentication Required"
Access-Control-Allow-Origin: *
Server: Werkzeug/0.16.0 Python/3.7.4
Date: Sun, 29 Dec 2019 07:01:35 GMT

Unauthorized Accessmikel_pan 
 
需要输入一个密码: 但是他无法验证这个密码

curl -i -H "Authorization:eyJhbGciOiJIUzUxMiIsImlhdCI6MTU3NzYwMjQ4OCwiZXhwIjoxNTc3NjAzMDg4fQ.eyJpZCI6MX0.1Z8MtJ6qlvFFvRrLIjhchL7ipB6aJgAXOzLU3Ir94owEhtmNWEjglAZTbITpljEMS960jPGEaeS7ouE5tD76jQ" -X GET -H "Content-Type: application/json" http://127.0.0.1:8000/api/login
HTTP/1.0 401 UNAUTHORIZED
Content-Type: text/html; charset=utf-8
Content-Length: 19
WWW-Authenticate: Basic realm="Authentication Required"
Access-Control-Allow-Origin: *
Server: Werkzeug/0.16.0 Python/3.7.4
Date: Sun, 29 Dec 2019 07:02:56 GMT

Unauthorized Access

ModuleNotFoundError: No module named 'MySQLdb'

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.