安装pip
wget http://mirrors.laohulab.com:9000/Django/get-pip.py |
安装Django版本(1.10.4)
pip install django==1.10.4 |
安装Django REST framework
pip install djangorestframework |
Add ‘rest_framework’ to your INSTALLED_APPS setting.
INSTALLED_APPS = (
…
‘rest_framework’,
)
If you’re intending to use the browsable API you’ll probably also want to add REST framework’s login and logout views. Add the following to your root urls.py file.
urlpatterns = [
…
url(r’^api-auth/‘, include(‘rest_framework.urls’, namespace=’rest_framework’))
]
Note that the URL path can be whatever you want, but you must include ‘rest_framework.urls’ with the ‘rest_framework’namespace. You may leave out the namespace in Django 1.9+, and REST framework will set it for you.
安装前端调试工具
pip install django-debugtools |
Configuration |