match4everyone / match4everything

Other
7 stars 0 forks source link

Redirect output of checks to stderr #117

Closed bjrne closed 4 years ago

bjrne commented 4 years ago

Currently, the output is on stdout, which prohibits for example the dumpdata command and possibly more. Using stdout is the cleaner solution anyway.

Baschdl commented 4 years ago

@maltezacharias Did you read somewhere that it's easily possible? I can't find anything on my first google search

maltezacharias commented 4 years ago

I didn't see anything I just asked whether the check output is indeed on STDOUT or STDERR, cause in the latter case we can easily redirect it on dumpdata. If Django outputs the checks on STDOUT I don't think there is anything we can or should do about that unless there is an option or something. Personally I don't understand why you would run the checks on a dump command but that's Django's decision I presume.

What we could als try, dumpdata has an -o option, did you use that? I guess that would also solve it

Baschdl commented 4 years ago

No, I didn't use -o

maltezacharias commented 4 years ago

Did a test. First of all there is --skip-checks for django-admin dumpdata. Which does what it says. Then there is -o / --output which also does what it says and prevents the system check output from being included in the file. Mind you if using docker-compose ... exec in a production setting you would then need to extract your file using a solution similar to backup.sh.

bjrne commented 4 years ago

So then this issue is about updating the Readme/documentation with the correct commands and possibly an explanation.

Baschdl commented 4 years ago

Mind you if using docker-compose ... exec in a production setting you would then need to extract your file using a solution similar to backup.sh

docker-compose exec backend bash -c "python3 manage.py dumpdata --skip-checks" > dump.json is probably the easier version