Django Collectstatic Django.How

Author avatar wrote on 30/05/2022

Collectstatic collects all static files inside all apps and put a copy inside the static directory declared in
eg: confing/static/img/photo.jpg –> static/img/photo.jpg
Important in production (when debug is false) because they will be served from that folder

python collectstatic --noinput

Some commonly used options are:

Do NOT prompt the user for input of any kind.
--noinput, --no-input
Ignore files, directories, or paths matching this glob-style pattern. Use multiple times to ignore more. When specifying a path, always use forward slashes, even on Windows.
--ignore PATTERN, -i PATTERN
Do everything except modify the filesystem.
--dry-run, -n
Clear the existing files before trying to copy or link the original file.
--clear, -c
Create a symbolic link to each file instead of copying.
--link, -l
Don’t call the post_process() method of the configured STATICFILES_STORAGE storage backend.
Don’t ignore the common private glob-style patterns ‘CVS’, ‘.*’ and ‘*~’.
For a full list of options, refer to the commands own help by running:
$ python collectstatic --help