From 04c43ec332f5341224fc2cb2387e473feecb7964 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Wed, 7 Jan 2026 16:08:45 -0500 Subject: [PATCH 1/7] remove matomo --- .../django_module/templates/base.html | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/{{ cookiecutter.project_slug }}/django_module/templates/base.html b/{{ cookiecutter.project_slug }}/django_module/templates/base.html index 0e1abf8..d9adf54 100644 --- a/{{ cookiecutter.project_slug }}/django_module/templates/base.html +++ b/{{ cookiecutter.project_slug }}/django_module/templates/base.html @@ -130,27 +130,6 @@ - - - - {% load render_bundle from webpack_loader %} {% render_bundle 'bootstrap' js %} From df2597f8847caa9d9433504050645441a5b0997b Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Mon, 12 Jan 2026 11:58:11 -0500 Subject: [PATCH 2/7] get node working when building new projects --- Dockerfile | 5 ++++- README.md | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 80e2fd6..a20bafd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,10 +8,13 @@ COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules RUN apt-get update && \ apt-get upgrade -y && \ - apt-get install -y git + apt-get install -y git libatomic1 RUN ["pip", "install", "--no-cache-dir", "setuptools", "cookiecutter"] +# Verify node is working +RUN node -v && npm -v + RUN mkdir /cookiecutter WORKDIR /cookiecutter ENTRYPOINT ["cookiecutter"] diff --git a/README.md b/README.md index 672c855..f5266cd 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ ## Usage +### Build cookiecutter container (Only need to do once) + +#### Option 1: From remote image (recommended) ```bash -# Build cookiecutter container (Only need to do once) docker build github.com/datamade/cookiecutter-django-app#main -t cookiecutter:latest # Generate a new project @@ -10,6 +12,16 @@ docker run -it \ cookiecutter gh:datamade/cookiecutter-django-app ``` +#### Option 2: From local files +```bash +docker build cookiecutter-django-app -t cookiecutter:latest + +# Generate a new project +docker run -it \ + --mount type=bind,source=$(pwd),target=/cookiecutter \ + cookiecutter cookiecutter-django-app +``` + ### Notes In order to make sure tests pass easily on your new repo so you can publish to Heroku, make sure to: - add all of the cookiecutter output as one initial commit to `main` From d12937159e41b2f3dcc45304dfe32dd35bd1722d Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Mon, 12 Jan 2026 11:59:40 -0500 Subject: [PATCH 3/7] resolve postgres 18+ config error --- {{ cookiecutter.project_slug }}/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{ cookiecutter.project_slug }}/docker-compose.yml b/{{ cookiecutter.project_slug }}/docker-compose.yml index 8b2a81a..d149ef6 100644 --- a/{{ cookiecutter.project_slug }}/docker-compose.yml +++ b/{{ cookiecutter.project_slug }}/docker-compose.yml @@ -53,7 +53,7 @@ services: POSTGRES_PASSWORD: postgres POSTGRES_DB: {{ cookiecutter.module_name }} volumes: - - {{ cookiecutter.module_name }}-db-data:/var/lib/postgresql/data + - {{ cookiecutter.module_name }}-db-data:/var/lib/postgresql ports: - 32001:5432 From b79c716fb626ef362c98dc5863fea7654575489d Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Mon, 12 Jan 2026 12:00:52 -0500 Subject: [PATCH 4/7] prevent use of postgis if not installed --- .../django_module/settings.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/{{ cookiecutter.project_slug }}/django_module/settings.py b/{{ cookiecutter.project_slug }}/django_module/settings.py index 282dbba..22e55c0 100644 --- a/{{ cookiecutter.project_slug }}/django_module/settings.py +++ b/{{ cookiecutter.project_slug }}/django_module/settings.py @@ -51,6 +51,7 @@ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + "django.contrib.postgres", {% if cookiecutter.install_wagtail %}"wagtail.contrib.forms", "wagtail.contrib.redirects", "wagtail.contrib.simple_translation", @@ -116,6 +117,7 @@ DATABASES = {} +{% if cookiecutter.install_postgis %} DATABASES["default"] = dj_database_url.parse( os.getenv( "DATABASE_URL", "postgis://postgres:postgres@postgres:5432/{{ cookiecutter.module_name }}" @@ -124,6 +126,16 @@ ssl_require=True if os.getenv("POSTGRES_REQUIRE_SSL") else False, engine="django.contrib.gis.db.backends.postgis", ) +{% else %} +DATABASES["default"] = dj_database_url.parse( + os.getenv( + "DATABASE_URL", "postgres://postgres:postgres@postgres:5432/{{ cookiecutter.module_name }}" + ), + conn_max_age=600, + ssl_require=True if os.getenv("POSTGRES_REQUIRE_SSL") else False, + engine="django.db.backends.postgresql", +) +{% endif %} # Caching # https://docs.djangoproject.com/en/stable/topics/cache/ From 144e1794125985f2afff26d59c10cc3cf749b9d9 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Mon, 12 Jan 2026 12:02:32 -0500 Subject: [PATCH 5/7] prevent premature creation of wagtail elements --- .../wagtail_module/migrations/0001_initial.py | 2 +- .../migrations/0002_examplemodel_examplemodeldetailpage.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/{{ cookiecutter.project_slug }}/wagtail_module/migrations/0001_initial.py b/{{ cookiecutter.project_slug }}/wagtail_module/migrations/0001_initial.py index bee15dd..281cb79 100644 --- a/{{ cookiecutter.project_slug }}/wagtail_module/migrations/0001_initial.py +++ b/{{ cookiecutter.project_slug }}/wagtail_module/migrations/0001_initial.py @@ -5,7 +5,7 @@ class Migration(migrations.Migration): dependencies = [ - ("wagtailcore", "0040_page_draft_title"), + ("wagtailcore", "0095_groupsitepermission"), ] operations = [ diff --git a/{{ cookiecutter.project_slug }}/wagtail_module/migrations/0002_examplemodel_examplemodeldetailpage.py b/{{ cookiecutter.project_slug }}/wagtail_module/migrations/0002_examplemodel_examplemodeldetailpage.py index 5edba2a..b600048 100644 --- a/{{ cookiecutter.project_slug }}/wagtail_module/migrations/0002_examplemodel_examplemodeldetailpage.py +++ b/{{ cookiecutter.project_slug }}/wagtail_module/migrations/0002_examplemodel_examplemodeldetailpage.py @@ -8,7 +8,6 @@ class Migration(migrations.Migration): dependencies = [ ("{{ cookiecutter.module_name }}", "0001_initial"), - ("wagtailcore", "0094_alter_page_locale"), ] operations = [ @@ -17,7 +16,7 @@ class Migration(migrations.Migration): fields=[ ( "id", - models.AutoField( + models.BigAutoField( auto_created=True, primary_key=True, serialize=False, From 95715362140458eefe3073723c353f5e8149a088 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Mon, 12 Jan 2026 12:23:12 -0500 Subject: [PATCH 6/7] adjust readme commands --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f5266cd..9079c38 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ docker build github.com/datamade/cookiecutter-django-app#main -t cookiecutter:latest # Generate a new project -docker run -it \ +docker run --rm -it \ --mount type=bind,source=$(pwd),target=/cookiecutter \ cookiecutter gh:datamade/cookiecutter-django-app ``` @@ -17,7 +17,7 @@ docker run -it \ docker build cookiecutter-django-app -t cookiecutter:latest # Generate a new project -docker run -it \ +docker run --rm -it \ --mount type=bind,source=$(pwd),target=/cookiecutter \ cookiecutter cookiecutter-django-app ``` From 81f7325b052c8480bdf728953f210d55d89a098c Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Mon, 12 Jan 2026 12:29:30 -0500 Subject: [PATCH 7/7] typo --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9079c38..b15f0fa 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ ## Usage -### Build cookiecutter container (Only need to do once) - -#### Option 1: From remote image (recommended) +### Option 1: From remote image (recommended) +Run this in whichever parent directory you'd like your project to live in. ```bash +# Build cookiecutter container to make sure it's up to date docker build github.com/datamade/cookiecutter-django-app#main -t cookiecutter:latest # Generate a new project @@ -12,8 +12,10 @@ docker run --rm -it \ cookiecutter gh:datamade/cookiecutter-django-app ``` -#### Option 2: From local files +### Option 2: From local files +Run this from the parent directory of this repo. Project will be built here. ```bash +# Build cookiecutter container to make sure it's up to date docker build cookiecutter-django-app -t cookiecutter:latest # Generate a new project