Compare commits
No commits in common. "1b3a2dec72330cbc7feb513cd4baffd3e022fa2c" and "94482f169667392d463b5863cf86910efaa9aad6" have entirely different histories.
1b3a2dec72
...
94482f1696
5 changed files with 11 additions and 70 deletions
|
@ -5,7 +5,6 @@ from django.db import models
|
||||||
from modelcluster.fields import ParentalKey, ParentalManyToManyField
|
from modelcluster.fields import ParentalKey, ParentalManyToManyField
|
||||||
from modelcluster.contrib.taggit import ClusterTaggableManager
|
from modelcluster.contrib.taggit import ClusterTaggableManager
|
||||||
from taggit.models import TaggedItemBase
|
from taggit.models import TaggedItemBase
|
||||||
from wagtail.api import APIField
|
|
||||||
|
|
||||||
from wagtail.models import Page, Orderable
|
from wagtail.models import Page, Orderable
|
||||||
from wagtail.fields import RichTextField, StreamField
|
from wagtail.fields import RichTextField, StreamField
|
||||||
|
@ -75,13 +74,6 @@ class BlogPage(SeoMixin, Page):
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Export fields over the API
|
|
||||||
api_fields = [
|
|
||||||
APIField('gallery_images'),
|
|
||||||
APIField('body'),
|
|
||||||
APIField('intro'),
|
|
||||||
APIField('tags'),
|
|
||||||
]
|
|
||||||
search_fields = Page.search_fields + [
|
search_fields = Page.search_fields + [
|
||||||
index.SearchField('intro'),
|
index.SearchField('intro'),
|
||||||
index.SearchField('body'),
|
index.SearchField('body'),
|
||||||
|
@ -130,9 +122,6 @@ class BlogPageGalleryImage(Orderable):
|
||||||
FieldPanel('image'),
|
FieldPanel('image'),
|
||||||
FieldPanel('caption'),
|
FieldPanel('caption'),
|
||||||
]
|
]
|
||||||
api_fields = [
|
|
||||||
APIField('image'),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@register_snippet
|
@register_snippet
|
||||||
|
|
|
@ -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)
|
|
|
@ -35,7 +35,6 @@ INSTALLED_APPS = [
|
||||||
"wagtail.contrib.settings",
|
"wagtail.contrib.settings",
|
||||||
"wagtail.contrib.forms",
|
"wagtail.contrib.forms",
|
||||||
"wagtail.contrib.redirects",
|
"wagtail.contrib.redirects",
|
||||||
"wagtail.contrib.simple_translation",
|
|
||||||
"wagtail.embeds",
|
"wagtail.embeds",
|
||||||
"wagtail.sites",
|
"wagtail.sites",
|
||||||
"wagtail.users",
|
"wagtail.users",
|
||||||
|
@ -44,9 +43,6 @@ INSTALLED_APPS = [
|
||||||
"wagtail.images",
|
"wagtail.images",
|
||||||
"wagtail.search",
|
"wagtail.search",
|
||||||
"wagtail.admin",
|
"wagtail.admin",
|
||||||
"wagtail.locales",
|
|
||||||
"wagtail.api.v2",
|
|
||||||
"rest_framework",
|
|
||||||
"wagtail",
|
"wagtail",
|
||||||
"modelcluster",
|
"modelcluster",
|
||||||
"taggit",
|
"taggit",
|
||||||
|
@ -72,7 +68,6 @@ MIDDLEWARE = [
|
||||||
"django.middleware.security.SecurityMiddleware",
|
"django.middleware.security.SecurityMiddleware",
|
||||||
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
|
"wagtail.contrib.redirects.middleware.RedirectMiddleware",
|
||||||
"blog.middleware.BlogRedirectMiddleware",
|
"blog.middleware.BlogRedirectMiddleware",
|
||||||
"django.middleware.locale.LocaleMiddleware",
|
|
||||||
"django_browser_reload.middleware.BrowserReloadMiddleware"
|
"django_browser_reload.middleware.BrowserReloadMiddleware"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -133,7 +128,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||||
# Internationalization
|
# Internationalization
|
||||||
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
# https://docs.djangoproject.com/en/5.0/topics/i18n/
|
||||||
|
|
||||||
LANGUAGE_CODE = "en"
|
LANGUAGE_CODE = "en-us"
|
||||||
|
|
||||||
TIME_ZONE = "UTC"
|
TIME_ZONE = "UTC"
|
||||||
|
|
||||||
|
@ -141,18 +136,6 @@ USE_I18N = True
|
||||||
|
|
||||||
USE_TZ = 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)
|
# Static files (CSS, JavaScript, Images)
|
||||||
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
# 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 -
|
# 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
|
# e.g. in notification emails. Don't include '/admin' or a trailing slash
|
||||||
WAGTAILADMIN_BASE_URL = "https://iamkonstantin.eu"
|
WAGTAILADMIN_BASE_URL = "https://iamkonstantin.eu"
|
||||||
WAGTAILAPI_BASE_URL = "https://iamkonstantin.eu"
|
|
||||||
|
|
||||||
WAGTAILAPI_SEARCH_ENABLED = True
|
|
||||||
|
|
||||||
WAGTAIL_CODE_BLOCK_LANGUAGES = (
|
WAGTAIL_CODE_BLOCK_LANGUAGES = (
|
||||||
('bash', 'Bash/Shell'),
|
('bash', 'Bash/Shell'),
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls.i18n import i18n_patterns
|
|
||||||
from django.urls import include, path
|
from django.urls import include, path
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.views.generic.base import TemplateView
|
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 wagtail.documents import urls as wagtaildocs_urls
|
||||||
|
|
||||||
from blog.feeds import RssBlogFeed
|
from blog.feeds import RssBlogFeed
|
||||||
from iamkonstantin_web.api import api_router
|
|
||||||
from newsletter import views as newsletter_views
|
from newsletter import views as newsletter_views
|
||||||
from search import views as search_views
|
from search import views as search_views
|
||||||
from wagtail.contrib.sitemaps.views import sitemap
|
from wagtail.contrib.sitemaps.views import sitemap
|
||||||
|
@ -27,17 +25,6 @@ urlpatterns = [
|
||||||
path('newsletter/thanks', newsletter_views.thanks, name='thanks')
|
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:
|
if settings.DEBUG:
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
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 += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
urlpatterns += path("__reload__/", include("django_browser_reload.urls")),
|
urlpatterns += path("__reload__/", include("django_browser_reload.urls")),
|
||||||
|
|
||||||
# urlpatterns = urlpatterns + [
|
urlpatterns = urlpatterns + [
|
||||||
# # For anything not caught by a more specific rule above, hand over to
|
# 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
|
# Wagtail's page serving mechanism. This should be the last pattern in
|
||||||
# # the list:
|
# the list:
|
||||||
# path("", include(wagtail_urls)),
|
path("", include(wagtail_urls)),
|
||||||
# # Alternatively, if you want Wagtail pages to be served from a subpath
|
# Alternatively, if you want Wagtail pages to be served from a subpath
|
||||||
# # of your site, rather than the site root:
|
# of your site, rather than the site root:
|
||||||
# # path("pages/", include(wagtail_urls)),
|
# path("pages/", include(wagtail_urls)),
|
||||||
# ]
|
]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
Django>=4.2,<5.2
|
Django>=4.2,<5.2
|
||||||
wagtail>=6.3.1,<6.4
|
wagtail>=6.3,<6.4
|
||||||
whitenoise>=6.6,<7.0
|
whitenoise>=6.6,<7.0
|
||||||
wagtailcodeblock>=1.29.0.2,<2.0
|
wagtailcodeblock>=1.29.0.2,<2.0
|
||||||
django-tailwind>=3.6.0
|
django-tailwind>=3.6.0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue