django使用问题记录

djangorestframework使用时,发现如下错误

AttributeError: 'OrderedDict' object has no attribute 'register'

原因是markdown版本太低

https://stackoverflow.com/questions/57479412/attributeerror-at-ordereddict-object-has-no-attribute-register-in-django-r

安装新版本解决

pip install markdown==3


调试工具:httpie

pip install httpie

使用:注意应用名字叫http

H:mysite>http http://127.0.0.1:8000/cookies/hello/
HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Content-Length: 27
Content-Type: application/json
Date: Wed, 03 Jun 2020 03:24:56 GMT
Server: WSGIServer/0.2 CPython/3.6.0
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
     "message": "Hello, World!"
}


Django REST Framework (DRF). The token authentication 的文章,很好!

https://simpleisbetterthancomplex.com/tutorial/2018/11/22/how-to-implement-token-authentication-using-django-rest-framework.html

原文地址:https://www.cnblogs.com/cute/p/13036334.html