When developing custom code, it is useful to be able to test this code and see the result obtained in order to correct errors or refine the code.
Athento allows the execution of custom commands without having to access the server console, directly from the user interface.
Pre-requisites for the execution of a custom command
- the user executing the command must be a superuser.
- the Athento installation must have command execution enabled.
- the commands that can be executed are those commands from custom Django applications, included in the server configuration files in the variable:
CUSTOM_INSTALLED_APPS
- para hacer que los datos de la ejecución del comando se vayan guardando y se muestren en la salida (como si se estuvieras haciendo un print en la consola de Python) el comando debe usar el método:
self.stdout.write(<aquello_que_queremos_que_se_muestre_tras_ejecutar_el_comando>)
Recommendations
- Command execution is enabled only in pre-production and on-demand instances.
- Never execute commands on non-test data or documents.
Execute a command
To execute these commands, go to the "Execute commands" option in the Advanced Administration menu.
In this screen, choose the command you want to execute. You will be able to indicate the parameters required to execute the command.
Once you have configured the execution of the command, you must click on Execute. The result of the execution will be shown in the section on the right "Result of the last execution".
Comments
0 comments
Please sign in to leave a comment.