django oscar的rest api模块
django-oscar-api的Python项目详细描述
这个包为django-oscar提供了一个restful api。
用法
要在oscar电子商务站点中使用oscar api应用程序,请遵循以下步骤 步骤:
安装django oscar api包(pip install django-oscar-api)。
将oscarapi添加到已安装的应用程序。
将应用程序的url添加到urlconf中
fromdjango.conf.urlsimporturlfromoscarapi.appimportapplicationasapiurlpatterns=(# all the things you already haveurl(r'^oscarapi/',api.urls),)
或者使用较新的django 2.x方式
fromdjango.urlsimportpathfromoscarapi.appimportapplicationasapiurlpatterns=(# all the things you already havepath('oscarapi/',api.urls),)
应用迁移:
python manage.py migrate
有关详细信息,请参见Documentation;有关发行说明,请参见Changelog。