Proper way for user authentication with angularjs and flask

前端 未结 2 1715
滥情空心
滥情空心 2021-01-31 05:59

I\'m currently working my way through Web development with flask. I want to build a webapp with flask as backend and angular.js at the frontend. The Json part is straight forwar

相关标签:
2条回答
  • 2021-01-31 06:59

    I have written several tutorials on RESTful APIs with Flask, all with examples that are ready to use:

    http://blog.miguelgrinberg.com/category/REST

    The tutorials are:

    • Designing a RESTful API with Python and Flask

      This is a simple RESTful API written in Flask, with authentication.

    • Writing a Javascript REST client

      In this one I implement a Javascript client for the API built in the first tutorial. Here you can see how the client authenticates. I used Knockout instead of Angular for the client, but the principles are the same.

    • Designing a RESTful API using Flask-RESTful

      This one is another way to write the server, using the Flask-RESTful extension to simplify some tasks.

    • RESTful Authentication with Flask

      This is a tutorial specifically dedicated to authentication.

    I hope they are useful.

    0 讨论(0)
  • 2021-01-31 07:02

    You can use flask-security together with Angular. You can even get CSRF support. I simply disabled WTFForms support and used the Flask backend only as REST API. I wrote a tutorial how to do this here. Source code is also available.

    0 讨论(0)
提交回复
热议问题