diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c9fcd53..179c4eb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,11 +24,11 @@ jobs: nodeenv -p && \ npm install -g npm-check-updates && \ find ./docker -name package.json -exec ncu --packageFile {} -u \; - - name: Push to main branch - run: | - git config --global user.name "xmedr" - git config --global user.email "xavier.medrano@datamade.us" + # - name: Push to main branch + # run: | + # git config --global user.name "xmedr" + # git config --global user.email "xavier.medrano@datamade.us" - git add . - git commit -m "Update pypi and node dependencies" - git push origin ${{ github.ref_name }} + # git add . + # git commit -m "Update pypi and node dependencies" + # git push origin ${{ github.ref_name }} diff --git a/docker/templates/new-django-app/{{cookiecutter.app_name}}/package.json b/docker/templates/new-django-app/{{cookiecutter.app_name}}/package.json index 11a0623..3faa245 100644 --- a/docker/templates/new-django-app/{{cookiecutter.app_name}}/package.json +++ b/docker/templates/new-django-app/{{cookiecutter.app_name}}/package.json @@ -25,12 +25,9 @@ "css-loader": "^7.1.2", "eslint": "^9.12.0", "eslint-config-prettier": "^9.1.0", - "eslint-config-react-app": "^7.0.1", - "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsx-a11y": "^6.10.0", "eslint-plugin-react": "^7.37.1", - "eslint-plugin-react-hooks": "^4.6.2", "style-loader": "^4.0.0", "webpack": "^5.95.0", "webpack-bundle-tracker": "^3.1.1", diff --git a/docker/templates/new-django-app/{{cookiecutter.app_name}}/requirements.txt b/docker/templates/new-django-app/{{cookiecutter.app_name}}/requirements.txt index dfe5a69..ee1e173 100644 --- a/docker/templates/new-django-app/{{cookiecutter.app_name}}/requirements.txt +++ b/docker/templates/new-django-app/{{cookiecutter.app_name}}/requirements.txt @@ -3,7 +3,7 @@ Django psycopg2 gunicorn -dj-database-url +django-environ whitenoise django-webpack-loader sentry-sdk diff --git a/docker/templates/new-django-app/{{cookiecutter.app_name}}/{{cookiecutter.module_name}}/settings.py b/docker/templates/new-django-app/{{cookiecutter.app_name}}/{{cookiecutter.module_name}}/settings.py index e455f56..deb7ff5 100644 --- a/docker/templates/new-django-app/{{cookiecutter.app_name}}/{{cookiecutter.module_name}}/settings.py +++ b/docker/templates/new-django-app/{{cookiecutter.app_name}}/{{cookiecutter.module_name}}/settings.py @@ -11,31 +11,37 @@ """ import os -import dj_database_url +import environ import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration from {{cookiecutter.module_name}}.logging import before_send + +env = environ.Env(DJANGO_DEBUG=(bool, True), + DJANGO_ALLOWED_HOSTS=(list, []), + SENTRY_DSN=(str, ''), + POSTGRES_REQUIRE_SSL=(bool, False), + DJANGO_ALLOW_SEARCH_INDEXING=(bool, False)) + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Retrieve the secret key from the DJANGO_SECRET_KEY environment variable -SECRET_KEY = os.environ['DJANGO_SECRET_KEY'] +SECRET_KEY = env('DJANGO_SECRET_KEY') # Set the DJANGO_DEBUG environment variable to False to disable debug mode -DEBUG = False if os.getenv('DJANGO_DEBUG', True) == 'False' else True +DEBUG = env("DJANGO_DEBUG") # Define DJANGO_ALLOWED_HOSTS as a comma-separated list of valid hosts, # e.g. localhost,127.0.0.1,.herokuapp.com -allowed_hosts = os.getenv('DJANGO_ALLOWED_HOSTS', []) -ALLOWED_HOSTS = allowed_hosts.split(',') if allowed_hosts else [] +ALLOWED_HOSTS = env('DJANGO_ALLOWED_HOSTS') # Configure Sentry for error logging -if os.getenv('SENTRY_DSN'): +if env('SENTRY_DSN'): sentry_sdk.init( - dsn=os.environ['SENTRY_DSN'], + dsn=env('SENTRY_DSN'), before_send=before_send, integrations=[DjangoIntegration()], ) @@ -90,17 +96,21 @@ DATABASES = {} -DATABASES['default'] = dj_database_url.parse( - os.getenv('DATABASE_URL', 'postgres://postgres:postgres@postgres:5432/{{cookiecutter.pg_db}}'), - conn_max_age=600, - ssl_require=True if os.getenv('POSTGRES_REQUIRE_SSL') else False{% if cookiecutter.postgis == 'True' %}, - engine='django.contrib.gis.db.backends.postgis'{% endif %} +# env.db_url returns a dictionary of database connection settings derived +# from the connection string. we have some settings we want to always use +# so we uniont those settings with one coming from the db string +DATABASES["default"] = { + "CONN_MAX_AGE": 600, + "OPTIONS": {"sslmode": "require" if env("POSTGRES_REQUIRE_SSL") else "prefer"}, +} | env.db_url( + "DATABASE_URL", + default='{{ "postgis" if cookiecutter.postgis else "postgres" }}://postgres:postgres@postgres:5432/{{cookiecutter.pg_db}}', ) # Caching # https://docs.djangoproject.com/en/3.0/topics/cache/ -cache_backend = 'dummy.DummyCache' if DEBUG is True else 'db.DatabaseCache' +cache_backend = 'dummy.DummyCache' if DEBUG else 'db.DatabaseCache' CACHES = { 'default': { 'BACKEND': f'django.core.cache.backends.{cache_backend}', @@ -146,9 +156,9 @@ STATIC_URL = '/static/' STATIC_ROOT = '/static' STATICFILES_DIRS = (os.path.join(BASE_DIR, "assets"),) -STATICFILES_STORAGE = os.getenv( +STATICFILES_STORAGE = env( 'DJANGO_STATICFILES_STORAGE', - 'whitenoise.storage.CompressedManifestStaticFilesStorage' + default='whitenoise.storage.CompressedManifestStaticFilesStorage' ) STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', @@ -171,7 +181,7 @@ # Disable search indexing by default. Set DJANGO_ALLOW_SEARCH_INDEXING env # variable to True in container or deploymeny environment to enable indexing. -if os.getenv('DJANGO_ALLOW_SEARCH_INDEXING', False) == 'True': +if env('DJANGO_ALLOW_SEARCH_INDEXING'): ALLOW_SEARCH_INDEXING = True else: ALLOW_SEARCH_INDEXING = False diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/Dockerfile b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/Dockerfile index 5afd690..032d2c0 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/Dockerfile +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/Dockerfile @@ -56,4 +56,4 @@ ENV DJANGO_DEBUG 'False' # Build static files into the container RUN python manage.py collectstatic --noinput -RUN python manage.py compress +#RUN python manage.py compress diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/package.json b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/package.json index 3fbf41d..1bea8be 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/package.json +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/package.json @@ -28,12 +28,9 @@ "@babel/eslint-parser": "^7.25.7", "eslint": "^9.12.0", "eslint-config-prettier": "^9.1.0", - "eslint-config-react-app": "^7.0.1", - "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsx-a11y": "^6.10.0", - "eslint-plugin-react": "^7.37.1", - "eslint-plugin-react-hooks": "^4.6.2" + "eslint-plugin-react": "^7.37.1" }, "scripts": { "develop": "sass --watch /app/{{ cookiecutter.module_name }}/static/scss/custom.scss:/app/{{ cookiecutter.module_name }}/static/css/bootstrap.custom.css" diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt index d1a8069..bcb60b1 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt @@ -1,14 +1,15 @@ Django==5.1.1 psycopg2==2.9.9 gunicorn==23.0.0 -dj-database-url==2.2.0 whitenoise==6.7.0 +django-environ==0.11.2 django-compressor==4.5.1 django-storages==1.14.4 boto3==1.35.34 sentry-sdk==2.15.0 wagtail==6.2.2 csvkit==2.0.1 +wagtail-modeladmin==2.0.0 pytest==8.3.3 pytest-django==4.9.0 diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/blocks.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/blocks.py index 5489ca5..91b3926 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/blocks.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/blocks.py @@ -1,4 +1,4 @@ -from wagtail.core import blocks +from wagtail import blocks from wagtail.contrib.table_block.blocks import TableBlock as WagtailTableBlock from wagtail.images.blocks import ImageChooserBlock diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/management/commands/load_cms_content.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/management/commands/load_cms_content.py index 59dc766..5a7757f 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/management/commands/load_cms_content.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/management/commands/load_cms_content.py @@ -3,13 +3,13 @@ import os import json -from django.core.files.storage import default_storage +from django.files.storage import default_storage from django.apps import apps -from django.core.management.base import BaseCommand -from django.core.management import call_command -from django.core.exceptions import ObjectDoesNotExist +from django.management.base import BaseCommand +from django.management import call_command +from django.exceptions import ObjectDoesNotExist -from wagtail.core.models import Site, Page, PageRevision +from wagtail.models import Site, Page, PageRevision from wagtail.images.models import Image diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/migrations/0001_initial.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/migrations/0001_initial.py index c9a5412..872f81b 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/migrations/0001_initial.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/migrations/0001_initial.py @@ -3,8 +3,8 @@ from django.db import migrations, models import django.db.models.deletion import {{ cookiecutter.module_name }}.blocks -import wagtail.core.blocks -import wagtail.core.fields +import wagtail.blocks +import wagtail.fields import wagtail.embeds.blocks import wagtail.images.blocks @@ -22,8 +22,8 @@ class Migration(migrations.Migration): name='HomePage', fields=[ ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), - ('body', wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock()), ('heading', wagtail.core.blocks.CharBlock(form_classname='full title', icon='title')), ('accordion', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('paragraph', wagtail.core.blocks.RichTextBlock())]), icon='list-ul')), ('button', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock()), ('link', wagtail.core.blocks.URLBlock())])), ('callout', wagtail.core.blocks.StructBlock([('paragraph', wagtail.core.blocks.RichTextBlock())])), ('table', {{ cookiecutter.module_name }}.blocks.TableBlock()), ('embedded_media', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock(required=False)), ('media_link', wagtail.embeds.blocks.EmbedBlock()), ('description', wagtail.core.blocks.TextBlock(required=False))], icon='media')), ('team_members', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('first_name', wagtail.core.blocks.CharBlock()), ('last_name', wagtail.core.blocks.CharBlock()), ('position', wagtail.core.blocks.CharBlock()), ('photo', wagtail.images.blocks.ImageChooserBlock(required=False))]), icon='group'))])), - ('intro_text', wagtail.core.fields.RichTextField(blank=True)), + ('body', wagtail.fields.StreamField([('paragraph', wagtail.blocks.RichTextBlock()), ('heading', wagtail.blocks.CharBlock(form_classname='full title', icon='title')), ('accordion', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('paragraph', wagtail.blocks.RichTextBlock())]), icon='list-ul')), ('button', wagtail.blocks.StructBlock([('text', wagtail.blocks.CharBlock()), ('link', wagtail.blocks.URLBlock())])), ('callout', wagtail.blocks.StructBlock([('paragraph', wagtail.blocks.RichTextBlock())])), ('table', {{ cookiecutter.module_name }}.blocks.TableBlock()), ('embedded_media', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('media_link', wagtail.embeds.blocks.EmbedBlock()), ('description', wagtail.blocks.TextBlock(required=False))], icon='media')), ('team_members', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('first_name', wagtail.blocks.CharBlock()), ('last_name', wagtail.blocks.CharBlock()), ('position', wagtail.blocks.CharBlock()), ('photo', wagtail.images.blocks.ImageChooserBlock(required=False))]), icon='group'))])), + ('intro_text', wagtail.fields.RichTextField(blank=True)), ], options={ 'abstract': False, @@ -34,7 +34,7 @@ class Migration(migrations.Migration): name='StaticPage', fields=[ ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.page')), - ('body', wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock()), ('heading', wagtail.core.blocks.CharBlock(form_classname='full title', icon='title')), ('accordion', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('paragraph', wagtail.core.blocks.RichTextBlock())]), icon='list-ul')), ('button', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.CharBlock()), ('link', wagtail.core.blocks.URLBlock())])), ('callout', wagtail.core.blocks.StructBlock([('paragraph', wagtail.core.blocks.RichTextBlock())])), ('table', {{ cookiecutter.module_name }}.blocks.TableBlock()), ('embedded_media', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock(required=False)), ('media_link', wagtail.embeds.blocks.EmbedBlock()), ('description', wagtail.core.blocks.TextBlock(required=False))], icon='media')), ('team_members', wagtail.core.blocks.ListBlock(wagtail.core.blocks.StructBlock([('first_name', wagtail.core.blocks.CharBlock()), ('last_name', wagtail.core.blocks.CharBlock()), ('position', wagtail.core.blocks.CharBlock()), ('photo', wagtail.images.blocks.ImageChooserBlock(required=False))]), icon='group'))])), + ('body', wagtail.fields.StreamField([('paragraph', wagtail.blocks.RichTextBlock()), ('heading', wagtail.blocks.CharBlock(form_classname='full title', icon='title')), ('accordion', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock()), ('paragraph', wagtail.blocks.RichTextBlock())]), icon='list-ul')), ('button', wagtail.blocks.StructBlock([('text', wagtail.blocks.CharBlock()), ('link', wagtail.blocks.URLBlock())])), ('callout', wagtail.blocks.StructBlock([('paragraph', wagtail.blocks.RichTextBlock())])), ('table', {{ cookiecutter.module_name }}.blocks.TableBlock()), ('embedded_media', wagtail.blocks.StructBlock([('title', wagtail.blocks.CharBlock(required=False)), ('media_link', wagtail.embeds.blocks.EmbedBlock()), ('description', wagtail.blocks.TextBlock(required=False))], icon='media')), ('team_members', wagtail.blocks.ListBlock(wagtail.blocks.StructBlock([('first_name', wagtail.blocks.CharBlock()), ('last_name', wagtail.blocks.CharBlock()), ('position', wagtail.blocks.CharBlock()), ('photo', wagtail.images.blocks.ImageChooserBlock(required=False))]), icon='group'))])), ], options={ 'abstract': False, diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/models.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/models.py index de8a809..a5b4347 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/models.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/models.py @@ -1,8 +1,8 @@ -from wagtail.core.models import Page -from wagtail.core.fields import RichTextField, StreamField -from wagtail.core import blocks +from wagtail.models import Page +from wagtail.fields import RichTextField, StreamField +from wagtail import blocks from wagtail.embeds.blocks import EmbedBlock -from wagtail.admin.edit_handlers import StreamFieldPanel, FieldPanel +from wagtail.admin.panels import FieldPanel from {{cookiecutter.module_name}}.blocks import ( AccordionBlock, @@ -53,7 +53,7 @@ class Meta: class StaticPage(BasePage): content_panels = Page.content_panels + [ - StreamFieldPanel('body'), + FieldPanel('body'), ] parent_page_types = ['{{ cookiecutter.module_name }}.HomePage'] @@ -64,7 +64,7 @@ class HomePage(BasePage): content_panels = Page.content_panels + [ FieldPanel('intro_text'), - StreamFieldPanel('body') + FieldPanel('body') ] max_count = 1 diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/settings.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/settings.py index c5130b8..fa577d9 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/settings.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/settings.py @@ -11,32 +11,38 @@ """ import os -import dj_database_url +import environ import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration from django.templatetags.static import static from {{cookiecutter.module_name}}.logging import before_send + +env = environ.Env(DJANGO_DEBUG=(bool, True), + DJANGO_ALLOWED_HOSTS=(list, []), + SENTRY_DSN=(str, ''), + POSTGRES_REQUIRE_SSL=(bool, False), + DJANGO_ALLOW_SEARCH_INDEXING=(bool, False)) + # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Retrieve the secret key from the DJANGO_SECRET_KEY environment variable -SECRET_KEY = os.environ['DJANGO_SECRET_KEY'] +SECRET_KEY = env('DJANGO_SECRET_KEY') # Set the DJANGO_DEBUG environment variable to False to disable debug mode -DEBUG = False if os.getenv('DJANGO_DEBUG', True) == 'False' else True +DEBUG = env('DJANGO_DEBUG') # Define DJANGO_ALLOWED_HOSTS as a comma-separated list of valid hosts, # e.g. localhost,127.0.0.1,.herokuapp.com -allowed_hosts = os.getenv('DJANGO_ALLOWED_HOSTS', []) -ALLOWED_HOSTS = allowed_hosts.split(',') if allowed_hosts else [] +ALLOWED_HOSTS = env('DJANGO_ALLOWED_HOSTS') # Configure Sentry for error logging -if os.getenv('SENTRY_DSN'): +if env('SENTRY_DSN'): sentry_sdk.init( - dsn=os.environ['SENTRY_DSN'], + dsn=env('SENTRY_DSN'), before_send=before_send, integrations=[DjangoIntegration()], ) @@ -51,7 +57,7 @@ 'django.contrib.messages', 'django.contrib.staticfiles', 'wagtail.contrib.forms', - 'wagtail.contrib.modeladmin', + 'wagtail_modeladmin', 'wagtail.contrib.redirects', 'wagtail.contrib.simple_translation', 'wagtail.contrib.table_block', @@ -64,7 +70,7 @@ 'wagtail.images', 'wagtail.search', 'wagtail.admin', - 'wagtail.core', + 'wagtail', 'modelcluster', 'taggit', 'compressor', @@ -117,12 +123,15 @@ DATABASES = {} -DATABASES['default'] = dj_database_url.parse( - os.getenv('DATABASE_URL', - 'postgis://postgres:postgres@postgres:5432/{{ cookiecutter.module_name }}'), - conn_max_age=600, - ssl_require=True if os.getenv('POSTGRES_REQUIRE_SSL') else False, - engine='django.contrib.gis.db.backends.postgis' +# env.db_url returns a dictionary of database connection settings derived +# from the connection string. we have some settings we want to always use +# so we uniont those settings with one coming from the db string +DATABASES["default"] = { + "CONN_MAX_AGE": 600, + "OPTIONS": {"sslmode": "require" if env("POSTGRES_REQUIRE_SSL") else "prefer"}, +} | env.db_url( + "DATABASE_URL", + default='postgis://postgres:postgres@postgres:5432/{{cookiecutter.module_name}}', ) # Caching @@ -173,9 +182,9 @@ STATIC_URL = '/static/' STATIC_ROOT = '/static' -STATICFILES_STORAGE = os.getenv( +STATICFILES_STORAGE = env( 'DJANGO_STATICFILES_STORAGE', - 'whitenoise.storage.CompressedManifestStaticFilesStorage' + default='whitenoise.storage.CompressedManifestStaticFilesStorage' ) STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/templatetags/pageurl_translate.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/templatetags/pageurl_translate.py index 7ab4791..42a980b 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/templatetags/pageurl_translate.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/templatetags/pageurl_translate.py @@ -1,5 +1,5 @@ from django import template -from wagtail.core.models import Page +from wagtail.models import Page register = template.Library() diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/templatetags/slugurl_translate.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/templatetags/slugurl_translate.py index 3a6c730..dfce1fb 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/templatetags/slugurl_translate.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/templatetags/slugurl_translate.py @@ -1,5 +1,5 @@ from django import template -from wagtail.core.models import Page +from wagtail.models import Page register = template.Library() diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/urls.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/urls.py index da44677..8c55f9c 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/urls.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/urls.py @@ -21,7 +21,7 @@ from .views import ReactView from wagtail.admin import urls as wagtailadmin_urls -from wagtail.core import urls as wagtail_urls +from wagtail import urls as wagtail_urls from wagtail.documents import urls as wagtaildocs_urls diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/utils.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/utils.py index 25fa26c..22225f6 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/utils.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/utils.py @@ -1,4 +1,4 @@ -from wagtail.core.models import Page +from wagtail.models import Page def get_site_menu(): diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/wagtail_hooks.py b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/wagtail_hooks.py index b06eac4..05a9e23 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/wagtail_hooks.py +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/{{ cookiecutter.module_name }}/wagtail_hooks.py @@ -1,8 +1,8 @@ from django.utils.html import escape from wagtail.admin.rich_text.converters.html_to_contentstate import BlockElementHandler import wagtail.admin.rich_text.editors.draftail.features as draftail_features -from wagtail.core import hooks -from wagtail.core.rich_text import LinkHandler +from wagtail import hooks +from wagtail.rich_text import LinkHandler @hooks.register('register_rich_text_features')