Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django command: How to insert newline in the help text?

I was looking to do something like this, but for a Django management command: Python argparse: How to insert newline in the help text?

like image 625
Seán Hayes Avatar asked Feb 18 '16 00:02

Seán Hayes


People also ask

What is help text in Django?

help_text attribute is used to display the “help” text along with the field in form in admin interface or ModelForm. It's useful for documentation even if your field isn't used on a form. For example, you can define the pattern of date to be taken as input in the help_text of DateField.

What is Django-admin command?

django-admin is Django's command-line utility for administrative tasks. This document outlines all it can do. In addition, manage.py is automatically created in each Django project.


1 Answers

You can insert the new line in help_text by entering the HTML
tag

For e.g.

name=models.Charfield(max_length=10, help_text="Enter First name or <br/> Enter full name")
like image 186
OM Tiwari Avatar answered Oct 10 '22 23:10

OM Tiwari