How to write a script that does collectstatic for django
I want to do an automatic collectstatic script for my django application. I tried various things but it did not work. My last attempt is to call an expect script within a normal script:
collectstatic.sh:
python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
testscript.sh:
#!/usr/bin/expect -f
spawn testscript.sh
expect "Type 'yes' to continue, or 'no' to cancel:"
send "yes"
However, the line ./testscript.sh
get never executed because the collectstatic
command before is waiting for input. How can I skip that ? I also tried leaving out the &&
but it didn't work.
Thanks in advance !
command-line bash scripts expect
add a comment |
I want to do an automatic collectstatic script for my django application. I tried various things but it did not work. My last attempt is to call an expect script within a normal script:
collectstatic.sh:
python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
testscript.sh:
#!/usr/bin/expect -f
spawn testscript.sh
expect "Type 'yes' to continue, or 'no' to cancel:"
send "yes"
However, the line ./testscript.sh
get never executed because the collectstatic
command before is waiting for input. How can I skip that ? I also tried leaving out the &&
but it didn't work.
Thanks in advance !
command-line bash scripts expect
It seems to me this question should be at StackOverflow...
– Alexandre
Nov 29 '15 at 5:47
no cause it is clearly a shell script question, all the others questions regarding shell/bash are on askubuntu as well, thanks for watching though !
– Paul Bernhard Wagner
Nov 29 '15 at 5:56
add a comment |
I want to do an automatic collectstatic script for my django application. I tried various things but it did not work. My last attempt is to call an expect script within a normal script:
collectstatic.sh:
python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
testscript.sh:
#!/usr/bin/expect -f
spawn testscript.sh
expect "Type 'yes' to continue, or 'no' to cancel:"
send "yes"
However, the line ./testscript.sh
get never executed because the collectstatic
command before is waiting for input. How can I skip that ? I also tried leaving out the &&
but it didn't work.
Thanks in advance !
command-line bash scripts expect
I want to do an automatic collectstatic script for my django application. I tried various things but it did not work. My last attempt is to call an expect script within a normal script:
collectstatic.sh:
python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
testscript.sh:
#!/usr/bin/expect -f
spawn testscript.sh
expect "Type 'yes' to continue, or 'no' to cancel:"
send "yes"
However, the line ./testscript.sh
get never executed because the collectstatic
command before is waiting for input. How can I skip that ? I also tried leaving out the &&
but it didn't work.
Thanks in advance !
command-line bash scripts expect
command-line bash scripts expect
asked Nov 29 '15 at 5:18
Paul Bernhard WagnerPaul Bernhard Wagner
2152511
2152511
It seems to me this question should be at StackOverflow...
– Alexandre
Nov 29 '15 at 5:47
no cause it is clearly a shell script question, all the others questions regarding shell/bash are on askubuntu as well, thanks for watching though !
– Paul Bernhard Wagner
Nov 29 '15 at 5:56
add a comment |
It seems to me this question should be at StackOverflow...
– Alexandre
Nov 29 '15 at 5:47
no cause it is clearly a shell script question, all the others questions regarding shell/bash are on askubuntu as well, thanks for watching though !
– Paul Bernhard Wagner
Nov 29 '15 at 5:56
It seems to me this question should be at StackOverflow...
– Alexandre
Nov 29 '15 at 5:47
It seems to me this question should be at StackOverflow...
– Alexandre
Nov 29 '15 at 5:47
no cause it is clearly a shell script question, all the others questions regarding shell/bash are on askubuntu as well, thanks for watching though !
– Paul Bernhard Wagner
Nov 29 '15 at 5:56
no cause it is clearly a shell script question, all the others questions regarding shell/bash are on askubuntu as well, thanks for watching though !
– Paul Bernhard Wagner
Nov 29 '15 at 5:56
add a comment |
2 Answers
2
active
oldest
votes
Why not just send yes
to the input of manage.py
:
python manage.py collectstatic --settings=app.settings_mark <<<yes &&
./testscript.sh
Or:
echo yes | python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
works ! great, thank you ! nice hack!
– Paul Bernhard Wagner
Nov 29 '15 at 22:08
2
You can accomplish the same thing with the noinput arg: manage.py collectstatic --noinput stackoverflow.com/questions/8705305/…
– ptevans
Nov 4 '16 at 0:34
add a comment |
You can try
python manage.py collectstatic --noinput
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f703762%2fhow-to-write-a-script-that-does-collectstatic-for-django%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Why not just send yes
to the input of manage.py
:
python manage.py collectstatic --settings=app.settings_mark <<<yes &&
./testscript.sh
Or:
echo yes | python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
works ! great, thank you ! nice hack!
– Paul Bernhard Wagner
Nov 29 '15 at 22:08
2
You can accomplish the same thing with the noinput arg: manage.py collectstatic --noinput stackoverflow.com/questions/8705305/…
– ptevans
Nov 4 '16 at 0:34
add a comment |
Why not just send yes
to the input of manage.py
:
python manage.py collectstatic --settings=app.settings_mark <<<yes &&
./testscript.sh
Or:
echo yes | python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
works ! great, thank you ! nice hack!
– Paul Bernhard Wagner
Nov 29 '15 at 22:08
2
You can accomplish the same thing with the noinput arg: manage.py collectstatic --noinput stackoverflow.com/questions/8705305/…
– ptevans
Nov 4 '16 at 0:34
add a comment |
Why not just send yes
to the input of manage.py
:
python manage.py collectstatic --settings=app.settings_mark <<<yes &&
./testscript.sh
Or:
echo yes | python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
Why not just send yes
to the input of manage.py
:
python manage.py collectstatic --settings=app.settings_mark <<<yes &&
./testscript.sh
Or:
echo yes | python manage.py collectstatic --settings=app.settings_mark &&
./testscript.sh
answered Nov 29 '15 at 6:11
murumuru
1
1
works ! great, thank you ! nice hack!
– Paul Bernhard Wagner
Nov 29 '15 at 22:08
2
You can accomplish the same thing with the noinput arg: manage.py collectstatic --noinput stackoverflow.com/questions/8705305/…
– ptevans
Nov 4 '16 at 0:34
add a comment |
works ! great, thank you ! nice hack!
– Paul Bernhard Wagner
Nov 29 '15 at 22:08
2
You can accomplish the same thing with the noinput arg: manage.py collectstatic --noinput stackoverflow.com/questions/8705305/…
– ptevans
Nov 4 '16 at 0:34
works ! great, thank you ! nice hack!
– Paul Bernhard Wagner
Nov 29 '15 at 22:08
works ! great, thank you ! nice hack!
– Paul Bernhard Wagner
Nov 29 '15 at 22:08
2
2
You can accomplish the same thing with the noinput arg: manage.py collectstatic --noinput stackoverflow.com/questions/8705305/…
– ptevans
Nov 4 '16 at 0:34
You can accomplish the same thing with the noinput arg: manage.py collectstatic --noinput stackoverflow.com/questions/8705305/…
– ptevans
Nov 4 '16 at 0:34
add a comment |
You can try
python manage.py collectstatic --noinput
add a comment |
You can try
python manage.py collectstatic --noinput
add a comment |
You can try
python manage.py collectstatic --noinput
You can try
python manage.py collectstatic --noinput
answered Feb 7 at 6:13
Susaj S NairSusaj S Nair
113
113
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f703762%2fhow-to-write-a-script-that-does-collectstatic-for-django%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It seems to me this question should be at StackOverflow...
– Alexandre
Nov 29 '15 at 5:47
no cause it is clearly a shell script question, all the others questions regarding shell/bash are on askubuntu as well, thanks for watching though !
– Paul Bernhard Wagner
Nov 29 '15 at 5:56