{# Only show the cancellation form on jobs that haven't been cancelled or finished yet. #} {% if not job.has_been_cancelled and not job.has_finished %}

Cancel job

{% csrf_token %} {% if job.has_started %} This job can't be cancelled anymore because it has already started running. {% else %}

Use this form to cancel this job. Only jobs that haven't started running yet can be cancelled.

{% endif %}
{% endif %}

Output

{% if job.is_in_progress %}
{% if job.finished_at and not job.has_finished_tasks %} This job has completed, but background tasks are still running. {% else %} This job is currently running. {% endif %}
{% elif job.has_been_cancelled %}
This job has been cancelled.
{% endif %} {% if job.output %}
{% csrf_token %}
{{ job.output }}
{% elif not job.has_been_cancelled and not job.has_finished %}
No output yet.
{% endif %} {% if job.has_finished %} {% if not job.output and show_warnings|default:True %}

This job hasn't generated any output. Maybe you should consider printing some of its progress using the management command print method?

For example:

            
                class Command(base_command.TempJobBaseCommand):
                    def handle(self, **options):
                        handle(self)

                def handle(cmd):
                    cmd.print("Starting command.")
                    for i in range(0, 40):
                        cmd.print(i)
                    cmd.print("Command ended.")
            
        
{% endif %} {% endif %}