diff --git a/blog/models.py b/blog/models.py index 64ad0d5..c0279c0 100644 --- a/blog/models.py +++ b/blog/models.py @@ -5,7 +5,6 @@ from django.db import models from modelcluster.fields import ParentalKey, ParentalManyToManyField from modelcluster.contrib.taggit import ClusterTaggableManager from taggit.models import TaggedItemBase -from wagtail.api import APIField from wagtail.models import Page, Orderable from wagtail.fields import RichTextField, StreamField @@ -75,13 +74,6 @@ class BlogPage(SeoMixin, Page): else: return None - # Export fields over the API - api_fields = [ - APIField('gallery_images'), - APIField('body'), - APIField('intro'), - APIField('tags'), - ] search_fields = Page.search_fields + [ index.SearchField('intro'), index.SearchField('body'), @@ -130,9 +122,6 @@ class BlogPageGalleryImage(Orderable): FieldPanel('image'), FieldPanel('caption'), ] - api_fields = [ - APIField('image'), - ] @register_snippet diff --git a/iamkonstantin_web/api.py b/iamkonstantin_web/api.py deleted file mode 100644 index 9415198..0000000 --- a/iamkonstantin_web/api.py +++ /dev/null @@ -1,15 +0,0 @@ -from wagtail.api.v2.views import PagesAPIViewSet -from wagtail.api.v2.router import WagtailAPIRouter -from wagtail.images.api.v2.views import ImagesAPIViewSet -from wagtail.documents.api.v2.views import DocumentsAPIViewSet - -# Create the router. "wagtailapi" is the URL namespace -api_router = WagtailAPIRouter('wagtailapi') - -# Add the three endpoints using the "register_endpoint" method. -# The first parameter is the name of the endpoint (such as pages, images). This -# is used in the URL of the endpoint -# The second parameter is the endpoint class that handles the requests -api_router.register_endpoint('pages', PagesAPIViewSet) -api_router.register_endpoint('images', ImagesAPIViewSet) -api_router.register_endpoint('documents', DocumentsAPIViewSet) \ No newline at end of file diff --git a/iamkonstantin_web/settings/base.py b/iamkonstantin_web/settings/base.py index d3cff38..44ac0f7 100644 --- a/iamkonstantin_web/settings/base.py +++ b/iamkonstantin_web/settings/base.py @@ -35,7 +35,6 @@ INSTALLED_APPS = [ "wagtail.contrib.settings", "wagtail.contrib.forms", "wagtail.contrib.redirects", - "wagtail.contrib.simple_translation", "wagtail.embeds", "wagtail.sites", "wagtail.users", @@ -44,9 +43,6 @@ INSTALLED_APPS = [ "wagtail.images", "wagtail.search", "wagtail.admin", - "wagtail.locales", - "wagtail.api.v2", - "rest_framework", "wagtail", "modelcluster", "taggit", @@ -72,7 +68,6 @@ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", "wagtail.contrib.redirects.middleware.RedirectMiddleware", "blog.middleware.BlogRedirectMiddleware", - "django.middleware.locale.LocaleMiddleware", "django_browser_reload.middleware.BrowserReloadMiddleware" ] @@ -133,7 +128,7 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization # https://docs.djangoproject.com/en/5.0/topics/i18n/ -LANGUAGE_CODE = "en" +LANGUAGE_CODE = "en-us" TIME_ZONE = "UTC" @@ -141,18 +136,6 @@ USE_I18N = True USE_TZ = True -WAGTAIL_I18N_ENABLED = True - -USE_L10N = True # allows dates to be shown in the user's locale - -WAGTAIL_CONTENT_LANGUAGES = LANGUAGES = [ - ('en', "English"), - ('fr', "French"), - ('es', "Spanish"), - ('nl', "Dutch"), -] - -WAGTAILSIMPLETRANSLATION_SYNC_PAGE_TREE = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/5.0/howto/static-files/ @@ -203,9 +186,6 @@ WAGTAILSEARCH_BACKENDS = { # Base URL to use when referring to full URLs within the Wagtail admin backend - # e.g. in notification emails. Don't include '/admin' or a trailing slash WAGTAILADMIN_BASE_URL = "https://iamkonstantin.eu" -WAGTAILAPI_BASE_URL = "https://iamkonstantin.eu" - -WAGTAILAPI_SEARCH_ENABLED = True WAGTAIL_CODE_BLOCK_LANGUAGES = ( ('bash', 'Bash/Shell'), diff --git a/iamkonstantin_web/urls.py b/iamkonstantin_web/urls.py index 4b29694..d53a50e 100644 --- a/iamkonstantin_web/urls.py +++ b/iamkonstantin_web/urls.py @@ -1,5 +1,4 @@ from django.conf import settings -from django.conf.urls.i18n import i18n_patterns from django.urls import include, path from django.contrib import admin from django.views.generic.base import TemplateView @@ -9,7 +8,6 @@ from wagtail import urls as wagtail_urls from wagtail.documents import urls as wagtaildocs_urls from blog.feeds import RssBlogFeed -from iamkonstantin_web.api import api_router from newsletter import views as newsletter_views from search import views as search_views from wagtail.contrib.sitemaps.views import sitemap @@ -27,17 +25,6 @@ urlpatterns = [ path('newsletter/thanks', newsletter_views.thanks, name='thanks') ] -urlpatterns += [ - path('api/v2/', api_router.urls), -] - -# Translatable URLs -# These will be available under a language code prefix. For example /en/search/ -urlpatterns += i18n_patterns( - path("", include(wagtail_urls)), - prefix_default_language=False, -) - if settings.DEBUG: from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns @@ -47,12 +34,12 @@ if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += path("__reload__/", include("django_browser_reload.urls")), -# urlpatterns = urlpatterns + [ -# # For anything not caught by a more specific rule above, hand over to -# # Wagtail's page serving mechanism. This should be the last pattern in -# # the list: -# path("", include(wagtail_urls)), -# # Alternatively, if you want Wagtail pages to be served from a subpath -# # of your site, rather than the site root: -# # path("pages/", include(wagtail_urls)), -# ] +urlpatterns = urlpatterns + [ + # For anything not caught by a more specific rule above, hand over to + # Wagtail's page serving mechanism. This should be the last pattern in + # the list: + path("", include(wagtail_urls)), + # Alternatively, if you want Wagtail pages to be served from a subpath + # of your site, rather than the site root: + # path("pages/", include(wagtail_urls)), +] diff --git a/requirements.txt b/requirements.txt index 04fcbe1..69558ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Django>=4.2,<5.2 -wagtail>=6.3.1,<6.4 +wagtail>=6.3,<6.4 whitenoise>=6.6,<7.0 wagtailcodeblock>=1.29.0.2,<2.0 django-tailwind>=3.6.0