29👍
✅
From the documentation
You can customize the instance by overriding this method and calling super() with kwargs of ArgumentParser parameters.
By overriding create_parser
method
you can set the formatter_class
of the ArgumentParser
:
from argparse import RawTextHelpFormatter
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def create_parser(self, *args, **kwargs):
parser = super(Command, self).create_parser(*args, **kwargs)
parser.formatter_class = RawTextHelpFormatter
return parser
3👍
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")
- Redirect request to admin interface
- Fabric – sudo -u
- How to embed matplotlib graph in Django webpage?
- Pycharm Can't retrieve image ID from build stream
- Django Multiple Databases Fallback to Master if Slave is down
Source:stackexchange.com