gpt4 book ai didi

database - 如何为 Django 应用程序配置数据库权限?

转载 作者:太空狗 更新时间:2023-10-30 01:40:47 27 4
gpt4 key购买 nike

我正在寻找有关如何正确配置数据库权限以保护 Django 应用程序的链接或答案?需要明确的是,我专门寻找处理数据库授权的 Material ,而不是 Django 框架本身内的权限。

最佳答案

来自 django 文档:

https://docs.djangoproject.com/en/dev/topics/install/

If you plan to use Django’s manage.py syncdb command to automatically create database tables for your models (after first installing Django and creating a project), you’ll need to ensure that Django has permission to create and alter tables in the database you’re using; if you plan to manually create the tables, you can simply grant Django SELECT, INSERT, UPDATE and DELETE permissions. On some databases, Django will need ALTER TABLE privileges during syncdb but won’t issue ALTER TABLE statements on a table once syncdb has created it. After creating a database user with these permissions, you’ll specify the details in your project’s settings file, see DATABASES for details.

关于database - 如何为 Django 应用程序配置数据库权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2322759/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com