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

标签 database django security permissions

我正在寻找有关如何正确配置数据库权限以保护 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/

相关文章:

sql-server - 如何将数据库设置为紧急模式?

sql unique 和对插入设置约束

Django:使用多个嵌套数组过滤 JSONField

python - Heroku 上的 Django manage.py 自定义命令

java - 使用基于表单的安全性时如何实现注销

mysql - cron 作业任务的日期时间问题

database - 由于 1 个数据库上的锁定问题,具有多个数据库的 Postgres 实例是否会在多个/所有数据库之间被阻止?

python - Heroku:将文件放入 bin 文件夹

c++ - 如何在有安全限制的情况下安全地编译和执行c++程序?

security - 如何让用户难以将 mp3 文件从我的站点保存到他们的硬盘?