postinst: never call manage.py in the postinst script
also do a collecstatic before each start
This commit is contained in:
parent
26ac8f8780
commit
2049a99df2
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
||||
;;
|
||||
|
||||
|
|
Reference in New Issue