Leo-G/Flask-Angularjs-JSON-Auth

语言: CSS

git: https://github.com/Leo-G/Flask-Angularjs-JSON-Auth

使用Flask和Angularjs进行JSON Web令牌身份验证(Satellizer)
JSON web token authentication with Flask and Angularjs (Satellizer)
README.md (中文)

烧瓶Angularjs-JSON-AUTH

使用Flask和Angularjs进行JSON Web令牌身份验证(Satellizer)

安装

  pip install -r requirements.txt
  vim config.py #Add your database details
  python db.py db init
  python db.py db migrate
  python db.py db upgrade
  vim create_user.py #Add a username password
  python create_user.py
  nohup uwsgi --socket 127.0.0.1:8001 --wsgi-file run.py --callable app --processes 4 --threads 2 --stats   127.0.0.1:9191 &
  vim /etc/nginx/sites-enabled/mysite.conf # Add the below config
      server {
                  listen 80;
                   server_name localhost;

                   location = /favicon.ico { access_log off; log_not_found off; }
                   location / {
                       root /path/to/Flask-Angularjs-JSON-Auth/angularjs-frontend/;
                        }

                  location /api {

                    uwsgi_pass 127.0.0.1:8001;
                    include uwsgi_params;
                 }
}

service nginx start

有关解释,请参阅http://techarena51.com/index.php/json-web-token-authentication-with-flask-and-angularjs/

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

Flask-Angularjs-JSON-Auth

JSON web token authentication with Flask and Angularjs (Satellizer)

Installation

  pip install -r requirements.txt
  vim config.py #Add your database details
  python db.py db init
  python db.py db migrate
  python db.py db upgrade
  vim create_user.py #Add a username password
  python create_user.py
  nohup uwsgi --socket 127.0.0.1:8001 --wsgi-file run.py --callable app --processes 4 --threads 2 --stats   127.0.0.1:9191 &
  vim /etc/nginx/sites-enabled/mysite.conf # Add the below config
      server {
                  listen 80;
                   server_name localhost;

                   location = /favicon.ico { access_log off; log_not_found off; }
                   location / {
                       root /path/to/Flask-Angularjs-JSON-Auth/angularjs-frontend/;
                        }

                  location /api {

                    uwsgi_pass 127.0.0.1:8001;
                    include uwsgi_params;
                 }
}

service nginx start

For explanation see http://techarena51.com/index.php/json-web-token-authentication-with-flask-and-angularjs/