diff --git a/roles/constellation/tasks/main.yml b/roles/constellation/tasks/main.yml
index 787b4aaca7ce642abcdda93a2e076dfed9f8217f..2eafe41eef443a38c569ba7023c244ff3efec546 100644
--- a/roles/constellation/tasks/main.yml
+++ b/roles/constellation/tasks/main.yml
@@ -56,21 +56,21 @@
     group: "{{ constellation.group }}"
     recurse: true
 
-- name: Indicate constellation in motd
+- name: Deploy Constellation settings_local.py
   template:
-    src: update-motd.d/05-service.j2
-    dest: /etc/update-motd.d/05-constellation
-    mode: 0755
+    src: constellation/settings_local.py.j2
+    dest: /var/local/constellation/constellation/settings_local.py
+    mode: 0660
+    owner: "{{ constellation.settings_local_owner }}"
+    group: "{{ constellation.settings_local_group }}"
 
 - name: Compile messages
   django_manage:
     command: compilemessages
     project_path: "/var/local/constellation"
 
-- name: Deploy Constellation settings_local.py
+- name: Indicate constellation in motd
   template:
-    src: constellation/settings_local.py.j2
-    dest: /var/local/constellation/constellation/settings_local.py
-    mode: 0660
-    owner: "{{ constellation.settings_local_owner }}"
-    group: "{{ constellation.settings_local_group }}"
+    src: update-motd.d/05-service.j2
+    dest: /etc/update-motd.d/05-constellation
+    mode: 0755
diff --git a/roles/constellation/templates/constellation/settings_local.py.j2 b/roles/constellation/templates/constellation/settings_local.py.j2
index 9b0810fe0e3a4b6e8b68a9d2d00f302ba6e622e9..af90a1b6d4be5aa40758929d2f64e270f512e359 100644
--- a/roles/constellation/templates/constellation/settings_local.py.j2
+++ b/roles/constellation/templates/constellation/settings_local.py.j2
@@ -1,8 +1,7 @@
-# -*- mode: python; coding: utf-8 -*-
 {{ ansible_header | comment }}
 
 # A secret key used by the server.
-SECRET_KEY = '{{ constellation.django_secret_key }}'
+SECRET_KEY = "{{ constellation.django_secret_key }}"
 
 # Should the server run in debug mode ?
 # SECURITY WARNING: don't run with debug turned on in production!
@@ -23,7 +22,7 @@ DATABASES = {
         'ENGINE': 'django.db.backends.postgresql_psycopg2',
         'NAME': '{{ constellation.database.name }}',
         'USER': '{{ constellation.database.user }}',
-        'PASSWORD': '{{ constellation.database.password }}',
+        'PASSWORD': "{{ constellation.database.password }}",
         'HOST': '{{ constellation.database.host }}',
         'PORT': '{{ constellation.database.port }}',
     },