Opened 5 years ago

Closed 5 years ago

#30417 closed Cleanup/optimization (wontfix)

Documentation missing for TemplateCommand.

Reported by: Christian González Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Although it is an official command in Django (ok, it is inherited by e.g. startproject), there is no documentation I could find in the docs about TemplateCommand. It would be good to mention it on https://docs.djangoproject.com/en/2.2/howto/custom-management-commands/#basecommand-subclasses - others are mentioned there. A few lines would suffice:

class TemplateCommand

A management command which creates a directory structure within a Django application using templates

TemplateCommand.handle(app_or_project, name, target=None, options)

app_or_project: The string 'app' or 'project'.
name: The name of the application or project.
directory: The directory to which the template should be copied.
options: The additional variables passed to project or app templates

This is mostly copied from the TemplateCommand docstring. Note that "directory" was renamed into "target" as init method's parameter, but kept as "directory" in the command argument (for compatibility reasons?).

Change History (1)

comment:1 by Mariusz Felisiak, 5 years ago

Component: Database layer (models, ORM)Documentation
Resolution: wontfix
Status: newclosed
Summary: Documentation missing for TemplateCommandDocumentation missing for TemplateCommand.
Version: 2.2master

Thanks for the report, however AppCommand and LabelCommand are reusable extensions of BaseCommand that's why they're documented. On the other hand TemplateCommand is a not reusable part of internals that's why it is not documented.

Note: See TracTickets for help on using tickets.
Back to Top