class documentation

class TemplateCommand(BaseCommand):

Known subclasses: django.core.management.commands.startapp.Command, django.core.management.commands.startproject.Command

View In Hierarchy

Copy either a Django application layout template or a Django project layout template into the specified directory.
Parameters
styleA color style object (see django.core.management.color).
app​_or​_projectThe string 'app' or 'project'.
nameThe name of the application or project.
directoryThe directory to which the template should be copied.
optionsThe additional variables passed to project or app templates
Method add​_arguments Entry point for subclassed commands to add custom arguments.
Method download Download the given URL and return the file name.
Method extract Extract the given file to a temporary directory and return the path of the directory with the extracted content.
Method handle The actual logic of the command. Subclasses must implement this method.
Method handle​_template Determine where the app or project templates are. Use django.__path__[0] as the default because the Django install directory isn't known.
Method is​_url Return True if the name looks like a URL.
Method make​_writeable Make sure that the file is writeable. Useful if our source is read-only.
Method splitext Like os.path.splitext, but takes off .tar, too
Method validate​_name Undocumented
Class Variable requires​_system​_checks Undocumented
Class Variable rewrite​_template​_suffixes Undocumented
Class Variable url​_schemes Undocumented
Instance Variable a​_or​_an Undocumented
Instance Variable app​_or​_project Undocumented
Instance Variable paths​_to​_remove Undocumented
Instance Variable verbosity Undocumented

Inherited from BaseCommand:

Method __init__ Undocumented
Method add​_base​_argument Call the parser's add_argument() method, suppressing the help text according to BaseCommand.suppressed_base_arguments.
Method check No summary
Method check​_migrations Print a warning if the set of migrations on disk don't match the migrations in the database.
Method create​_parser Create and return the ArgumentParser which will be used to parse the arguments to this command.
Method execute Try to execute this command, performing system checks if needed (as controlled by the requires_system_checks attribute, except if force-skipped).
Method get​_version Return the Django version, which should be correct for all built-in Django commands. User-supplied commands can override this method to return their own version.
Method print​_help Print the help message for this command, derived from self.usage().
Method run​_from​_argv No summary
Class Variable base​_stealth​_options Undocumented
Class Variable help Undocumented
Class Variable output​_transaction Undocumented
Class Variable requires​_migrations​_checks Undocumented
Class Variable stealth​_options Undocumented
Class Variable suppressed​_base​_arguments Undocumented
Instance Variable ​_called​_from​_command​_line Undocumented
Instance Variable stderr Undocumented
Instance Variable stdout Undocumented
Instance Variable style Undocumented
def add_arguments(self, parser):
Entry point for subclassed commands to add custom arguments.
def download(self, url):
Download the given URL and return the file name.
def extract(self, filename):
Extract the given file to a temporary directory and return the path of the directory with the extracted content.
def handle(self, app_or_project, name, target=None, **options):
The actual logic of the command. Subclasses must implement this method.
def handle_template(self, template, subdir):
Determine where the app or project templates are. Use django.__path__[0] as the default because the Django install directory isn't known.
def is_url(self, template):
Return True if the name looks like a URL.
def make_writeable(self, filename):
Make sure that the file is writeable. Useful if our source is read-only.
def splitext(self, the_path):
Like os.path.splitext, but takes off .tar, too
def validate_name(self, name, name_or_dir='name'):

Undocumented

requires_system_checks: list =
rewrite_template_suffixes: tuple =

Undocumented

url_schemes: list[str] =

Undocumented

a_or_an =

Undocumented

app_or_project =

Undocumented

paths_to_remove: list =

Undocumented

verbosity =

Undocumented