Django :How to integrate Django Rest framework in an existing application?

后端 未结 2 1839
难免孤独
难免孤独 2021-02-05 22:44

How should I integrate Django-REST-API framework in an existing application or I have to create a new project?

2条回答
  •  太阳男子
    2021-02-05 22:59

    You do not need to begin a new project. The basic steps are:

    1. Install DRF, something like pip install djangorestframework
    2. Add rest_framework to your INSTALLED_APPS
    3. Define your serialisers, views and routes.

    And that's it.

    I suggest you follow the Quickstart and step through the Tutorial — it's pretty welcoming really.

    I hope that helps.

提交回复
热议问题