python - 如何在 django 中使用在 Laravel 中注册的注册用户?
问题描述
该网站是在 Laravel 中开发的。我想在其中添加一些功能。请帮助我如何获得在 Laravel 中注册的 django 用户?
解决方案
The database is independent from Laravel, so you can use it with Django. The db table containing users already exists, so you don' t need to make migrations.
First add your database in your Django settings file:
DATABASES = {
'default': {
# Database info
}
}
Django can generate models for you by inspecting the database:
python manage.py inspectdb
Now use the output to create interested models (note that you should refine the result), you need also to create one or more apps to contain model files.
Finally you need to creates some db tables that Django uses internally (for example for permissions):
python manage.py migrate
推荐阅读
- r - 是否可以在 R 中仅显示带有 ggplot 的特定刻度线?
- python - 使用 Ironclad 在 Iron Python 中实现 Opencv
- python - 从 GitHub (urllib.request) 下载 csv 文件时出错
- linux - x86 中的分段与 linux 下编译器中的分段
- testing - 如何在 Azure DevOps 中运行未完成时更改其状态
- asp.net-core - 尝试激活“XXXXX”时无法解析“Microsoft.AspNetCore.SignalR.Hub`1[IXXXX]”类型的服务
- java - 使用attributeconverter时,SpringBoot应用程序未完成启动
- php - 为什么我的 ionic 应用程序不显示来自 Android 数据库的数据?
- laravel - 如何模拟 Laravel Auth 门面的给定方法
- javascript - 如何使用 ref 在 react.js 中的两个按钮之间切换?