[英]I have an existing Django Webapp, how do I make a rest API to integrate the webapp with an android app?
I have an existing django webapp, I have two model classes in my models.py for different functionalities in my app.我有一个现有的 django webapp,我的 models.py 中有两个 model 类,用于我的应用程序中的不同功能。 I have used django allauth for all of the login/logout/social sign ins .我已将 django allauth 用于所有登录/注销/社交登录。 Note: I have not used django rest framework at all so far in creating my app.注意:到目前为止,我在创建我的应用程序时根本没有使用 django rest 框架。 Now, I have to do the same for the android version of my webapp using Java.现在,我必须使用 Java 对我的 webapp 的 android 版本执行相同的操作。 What exactly do I need to do right now to create the rest APIs and then connect them to the android app?我现在需要做什么来创建 rest API,然后将它们连接到 android 应用程序? please give some suggestions请给一些建议
dj-rest-auth
Drop-in API endpoints for handling authentication securely in Django Rest Framework. dj-rest-auth
Drop-in API 端点,用于在 Django Rest 框架中安全地处理身份验证。 it depends on django allauth
, easy to integrate and have a good documentation.它依赖于django allauth
,易于集成并具有良好的文档。
yes you have to create new rest API for the android apps.是的,您必须为 android 应用程序创建新的 rest API。 Authentication will be token based for the rest API.身份验证将基于 rest API 的令牌。 storing tokens and retrieving data will be handled by the android app.存储令牌和检索数据将由 android 应用程序处理。 The stable authentication for Django is Simplejwt Django 的稳定认证是 Simplejwt
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.