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.
asked Jun 10, 2011 at 15:54
szaman
6,78414 gold badges57 silver badges81 bronze badges
1 Answer 1
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.
answered Jun 10, 2011 at 16:01
shanyu
9,7368 gold badges63 silver badges69 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py