From 3853f239b0426377b5c07dcc52a4b31e26b31ecc Mon Sep 17 00:00:00 2001 From: Erick Otenyo Date: Tue, 8 Oct 2024 09:44:03 +0300 Subject: [PATCH 1/4] Remove type attribute from rss item link --- climweb/src/climweb/pages/cap/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/climweb/src/climweb/pages/cap/views.py b/climweb/src/climweb/pages/cap/views.py index c02da91d..ede7ed7c 100644 --- a/climweb/src/climweb/pages/cap/views.py +++ b/climweb/src/climweb/pages/cap/views.py @@ -17,6 +17,7 @@ from django.utils.xmlutils import SimplerXMLGenerator from wagtail.models import Site + from climweb.base.cache import wagcache from .models import ( CapAlertPage, @@ -80,7 +81,7 @@ def add_root_elements(self, handler): def add_item_elements(self, handler, item): handler.addQuickElement("title", item["title"]) - handler.addQuickElement("link", item["link"], attrs={"type": "application/cap+xml"}) + handler.addQuickElement("link", item["link"]) if item["description"] is not None: handler.addQuickElement("description", item["description"]) From c0320a2b56cabd0703772a1f16150f7de9eb7e60 Mon Sep 17 00:00:00 2001 From: Erick Otenyo Date: Wed, 9 Oct 2024 13:01:25 +0300 Subject: [PATCH 2/4] Add manage script --- climweb/pyproject.toml | 3 +++ climweb/src/climweb/manage.py | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/climweb/pyproject.toml b/climweb/pyproject.toml index 34437cf2..963aa36c 100644 --- a/climweb/pyproject.toml +++ b/climweb/pyproject.toml @@ -38,6 +38,9 @@ include-package-data = true # https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html platforms = ["Linux"] +[project.scripts] +manage = "climweb.manage:main" + #[tool.setuptools.package-data] [tool.setuptools.packages.find] diff --git a/climweb/src/climweb/manage.py b/climweb/src/climweb/manage.py index e0474504..c4cf09aa 100755 --- a/climweb/src/climweb/manage.py +++ b/climweb/src/climweb/manage.py @@ -2,9 +2,14 @@ import os import sys -if __name__ == "__main__": + +def main(): os.environ.setdefault("DJANGO_SETTINGS_MODULE", "climweb.config.settings.dev") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv) + + +if __name__ == "__main__": + main() From 4a8e29e905b24b0a194f696093878e4f6db2f035 Mon Sep 17 00:00:00 2001 From: Erick Otenyo Date: Thu, 10 Oct 2024 18:06:48 +0300 Subject: [PATCH 3/4] Update STATICFILES_STORAGE --- climweb/src/climweb/config/settings/dev.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/climweb/src/climweb/config/settings/dev.py b/climweb/src/climweb/config/settings/dev.py index c2ba6656..f5a6a00b 100644 --- a/climweb/src/climweb/config/settings/dev.py +++ b/climweb/src/climweb/config/settings/dev.py @@ -21,7 +21,7 @@ INSTALLED_APPS = ["daphne"] + INSTALLED_APPS + ["wagtail.contrib.styleguide"] -STATICFILES_STORAGE = "base.storage.ManifestStaticFilesStorageNotStrict" +STATICFILES_STORAGE = "climweb.base.storage.ManifestStaticFilesStorageNotStrict" SHOW_TOOLBAR_CALLBACK = False SHOW_COLLAPSED = False From 5bd74075988bc8ca22cbbf68cd987db1460fa1bf Mon Sep 17 00:00:00 2001 From: Erick Otenyo Date: Thu, 10 Oct 2024 18:07:15 +0300 Subject: [PATCH 4/4] Update stations model __module__ --- climweb/src/climweb/pages/stations/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/climweb/src/climweb/pages/stations/models.py b/climweb/src/climweb/pages/stations/models.py index 0c1bdfed..4f55c51a 100644 --- a/climweb/src/climweb/pages/stations/models.py +++ b/climweb/src/climweb/pages/stations/models.py @@ -64,7 +64,7 @@ def get_station_model(self): attrs = { **fields, "managed": False, - "__module__": "pages.stations" + "__module__": "climweb.pages.stations" } station_model = type("Station", (models.Model,), attrs)