开发者

Execute python command in django admin panel

Is it possible to execute python command in admin panel or in django view?I. e. if I would like to sync database in my app using a 开发者_运维问答button.


Write a custom admin view featuring a form, and when the form is submitted in the view call django.core.management.call_command

Remark regarding using a form: As your request will change things at the server-side, a post must be preferred over a get.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜