postinst: never call manage.py in the postinst script

also do a collecstatic before each start
This commit is contained in:
Benjamin Dauvergne 2014-04-25 15:17:16 +02:00
parent 26ac8f8780
commit 2049a99df2
2 changed files with 3 additions and 9 deletions

3
debian/init.d vendored
View File

@ -112,6 +112,9 @@ do_reload() {
}
do_migrate() {
log_action_msg "Generating static files .."
su $USER -p -c "/usr/bin/compte-agglo-montpellier collectstatic --noinput --link"
log_action_msg ".. done"
log_action_msg "Applying new migrations .."
su $USER -p -c "/usr/bin/compte-agglo-montpellier syncdb --migrate --noinput"
log_action_msg ".. done"

9
debian/postinst vendored
View File

@ -28,15 +28,6 @@ case "$1" in
chown $USER:$GROUP /var/lib/compte-agglo-montpellier /var/run/compte-agglo-montpellier /var/log/compte-agglo-montpellier
chown $USER:$GROUP /var/lib/compte-agglo-montpellier/static /var/lib/compte-agglo-montpellier/extra-static
chown $USER:$GROUP /var/lib/compte-agglo-montpellier/media
echo -n "Generating static files.."
su compte-agglo-montpellier -p -c "/usr/bin/compte-agglo-montpellier collectstatic --noinput --link"
echo "..done"
if [ -z "$2" ]; then
echo -n "Generating database.."
su compte-agglo-montpellier -p -c "/usr/bin/compte-agglo-montpellier syncdb --all --noinput"
su compte-agglo-montpellier -p -c "/usr/bin/compte-agglo-montpellier migrate --fake"
echo "..done"
fi
;;