<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compilemessages(application):
 """ Compiles locale messages """

    from django.core.management import call_command

    with work_in(application):
        if DJANGO_1_11:
            call_command('compilemessages', all=True)
        else:
            call_command('compilemessages')