Commands¶
renderstatic¶
Generate documents from templates and write them to disk at either pre-configured locations or in their associated Django app’s static directory if residing within an app. This command should be run during the deployment phase and always before collectstatic is run.
This command accepts a list of template names to render. If no names are
specified all templates as specified in STATIC_TEMPLATES will be rendered.
A template name supplied as an argument does not need to be specified in
STATIC_TEMPLATES for it to be found and rendered. Such templates will be
given the global context as specified in STATIC_TEMPLATES.
Usage¶
Example¶
To generate all templates configured in STATIC_TEMPLATES settings:
$ manage.py renderstatic
Alternatively individual templates can be generated, regardless of their presence in
STATIC_TEMPLATES. They will be given the global context with any overriding context
parameters supplied on the command line:
$ manage.py renderstatic path/*.js -c ./js_context.yaml -d outputdir