I need to work with Persian language. Persian is right aligned so I want the labels of model fields to appear on the right side of the input box.
I tried to change the admin page CSS but it didn't work.(I changed text-aligned
to right-aligned
).
I need to work with Persian language. Persian is right aligned so I want the labels of model fields to appear on the right side of the input box.
I tried to change the admin page CSS but it didn't work.(I changed text-aligned
to right-aligned
).
Could try adding this to the css:
.form-row div {
display:flex;
flex-direction: row-reverse;
}
You could also use direction: rtl
instead of flex-direction: row-reverse
This works because the structure of the generated html will be something like:
<div class="form-row>
<div>
<label ...>
<input ...>
</div>
</div>
Depending on how complicated the layout it, this might not work 100%, I've not looked at how it will affect inlines and other ways you can lay things out in the django-admin, but some variation of it should fix your basic problem.