From 1bad06488e35c4a2a3d07d4b48caeb8993b7d26a Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Wed, 15 Jul 2026 11:08:06 +0200 Subject: [PATCH 1/2] Add guard to prevent bad settings import --- templates/github/pyproject.toml.tool.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/github/pyproject.toml.tool.j2 b/templates/github/pyproject.toml.tool.j2 index feab7559..a8252ef4 100644 --- a/templates/github/pyproject.toml.tool.j2 +++ b/templates/github/pyproject.toml.tool.j2 @@ -78,6 +78,7 @@ extend-select = [ [tool.ruff.lint.flake8-tidy-imports.banned-api] # This section is managed by the plugin template. Do not edit manually. "distutils".msg = "The 'distutils' module has been deprecated since Python 3.9." +"pulpcore.app.settings".msg = "Always import 'settings' from 'django.conf' instead." {%- if plugin_name != "pulpcore" %} "pulpcore.app".msg = "The 'pulpcore' apis must only be consumed via 'pulpcore.plugin'." {%- endif %} From f74899fed83ae27ab844cb35a789f66b599fc7e1 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Wed, 15 Jul 2026 15:16:35 +0200 Subject: [PATCH 2/2] Template django_secret in CI --- templates/github/.ci/ansible/settings.py.j2.copy | 1 + templates/github/.ci/ansible/start_container.yaml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/templates/github/.ci/ansible/settings.py.j2.copy b/templates/github/.ci/ansible/settings.py.j2.copy index ab8ebb3d..0b8a1a16 100644 --- a/templates/github/.ci/ansible/settings.py.j2.copy +++ b/templates/github/.ci/ansible/settings.py.j2.copy @@ -1,3 +1,4 @@ +SECRET_KEY = "{{ django_secret }}" CONTENT_ORIGIN = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}" ANSIBLE_API_HOSTNAME = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}" ANSIBLE_CONTENT_HOSTNAME = "{{ pulp_scheme }}://pulp:{{ 443 if pulp_scheme == 'https' else 80 }}/pulp/content" diff --git a/templates/github/.ci/ansible/start_container.yaml b/templates/github/.ci/ansible/start_container.yaml index e0891b7a..4ef94c86 100644 --- a/templates/github/.ci/ansible/start_container.yaml +++ b/templates/github/.ci/ansible/start_container.yaml @@ -18,6 +18,8 @@ ansible.builtin.template: src: "settings.py.j2" dest: "settings/settings.py" + vars: + django_secret: "lookup('community.general.random_string', length=50, overwrite_all='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)')" - name: "Setup docker networking" community.docker.docker_network: