首页 > 解决方案 > 如何在 django 中使用在 Laravel 中注册的注册用户?

问题描述

该网站是在 Laravel 中开发的。我想在其中添加一些功能。请帮助我如何获得在 Laravel 中注册的 django 用户?

标签: pythonphpdjangolaravel

解决方案


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

推荐阅读