[Answer]-Django – use locale out of view

1👍

I think that you can only change the language and formatting depends on it. In that case, you can do something like this:

from django.utils.translation import activate

def my_async_fu(user_id):
    u = User.objects.fet(id=user_id)
    activate(u.my_lang_code_field)
    # Do whatever you want       
👤Bruce

Leave a comment