Django REST framework序列化
准备新环境
virtualenv env
source env/bin/activate
pip install django
pip install djangorestframework
pip install pygments # We'll be using this for the code highlightingdjango-admin.py startproject tutorial
cd tutorial
python manage.py startapp snippetsINSTALLED_APPS = (
...
'rest_framework',
'snippets.apps.SnippetsConfig',
)创建一个用于工作的模型(a model to work with)
创建一个序列化类
参考
Last updated