Skip to content

Commit

Permalink
Release (#1643)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbiggs authored Jun 11, 2024
2 parents 480d5a9 + 905f463 commit 13b5d83
Show file tree
Hide file tree
Showing 48 changed files with 4,105 additions and 341 deletions.
16 changes: 16 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,19 @@
FEATURE_DISABLE_JS_WHATS_ON_LISTING = strtobool(
os.getenv("FEATURE_DISABLE_JS_WHATS_ON_LISTING", "False")
)

if redis_url := os.getenv("REDIS_URL"):
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": redis_url,
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
},
},
"renditions": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": redis_url,
"KEY_PREFIX": "renditions",
},
}
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
- media:/media
depends_on:
- db
- redis
ports:
- 8000:8080
command: sh /app/bash/run-dev.sh
Expand All @@ -48,6 +49,7 @@ services:
- FEATURE_BETA_BANNER_ENABLED=False
- KEEP_ALIVE=30
- WAGTAILAPI_BASE_URL=http://host.docker.internal:8000
- REDIS_URL=redis://:redis@redis:6379

cli:
container_name: cli
Expand Down Expand Up @@ -87,5 +89,12 @@ services:
- DATABASE_NAME=postgres
- DATABASE_USER=postgres

redis:
container_name: redis
image: redis:latest
command: /bin/sh -c "redis-server --requirepass redis"
ports:
- 6379:6379

volumes:
media:
Empty file added etna/api/__init__.py
Empty file.
Empty file added etna/api/tests/__init__.py
Empty file.
404 changes: 404 additions & 0 deletions etna/api/tests/expected_results/article.json

Large diffs are not rendered by default.

164 changes: 164 additions & 0 deletions etna/api/tests/expected_results/article_index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
{
"id": ARTICLE_INDEX_ID,
"meta": {
"type": "articles.ArticleIndexPage",
"detail_url": "/api/v2/pages/ARTICLE_INDEX_ID/",
"html_url": "http://localhost/article_index/",
"slug": "article_index",
"show_in_menus": false,
"seo_title": "",
"search_description": "",
"first_published_at": "2000-01-01T00:00:00Z",
"alias_of": null,
"parent": {
"id": HOME_PAGE_ID,
"meta": {
"type": "home.HomePage",
"detail_url": "/api/v2/pages/HOME_PAGE_ID/",
"html_url": "http://localhost/"
},
"title": "Home"
}
},
"title": "article_index",
"type_label": "Article index",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 11,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_4ShM0BL.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60_4ShM0BL.jpg",
"width": 100,
"height": 68
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-80_7hLyRgB.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-80_7hLyRgB.webp",
"width": 100,
"height": 68
}
},
"teaser_image_large": {
"id": 11,
"title": "An image",
"jpeg": {
"url": "/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_NwigGNI.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-1200x480.format-jpeg.jpegquality-60_NwigGNI.jpg",
"width": 100,
"height": 40
},
"webp": {
"url": "/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-80_HpAlGCn.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/examp.2e16d0ba.fill-1200x480.format-webp.webpquality-80_HpAlGCn.webp",
"width": 100,
"height": 40
}
},
"teaser_image_square": {
"id": 11,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_faOjnDM.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-512x512.format-jpeg.jpegquality-60_faOjnDM.jpg",
"width": 100,
"height": 100
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-80_ppQbvU2.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-512x512.format-webp.webpquality-80_ppQbvU2.webp",
"width": 100,
"height": 100
}
},
"facebook_og_image": null,
"twitter_og_image": null,
"intro": "<p>Intro text</p>",
"featured_article": {
"id": ARTICLE_ID,
"title": "article",
"url": "/article_index/article/",
"full_url": "http://localhost/article_index/article/",
"type_label": "The story of",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 12,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg",
"width": 100,
"height": 68
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-80.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-80.webp",
"width": 100,
"height": 68
}
},
"is_newly_published": false
},
"featured_pages": [
{
"type": "featuredpages",
"value": {
"heading": "Featured pages heading",
"description": "Featured pages description",
"items": [
{
"id": ARTICLE_ID,
"title": "article",
"url": "/article_index/article/",
"full_url": "http://localhost/article_index/article/",
"type_label": "The story of",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 12,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg",
"width": 100,
"height": 68
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-80.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-80.webp",
"width": 100,
"height": 68
}
},
"is_newly_published": false
},
{
"id": FOCUSED_ID,
"title": "focused_article",
"url": "/article_index/focused_article/",
"full_url": "http://localhost/article_index/focused_article/",
"type_label": "Focus on",
"teaser_text": "Teaser text",
"teaser_image": {
"id": 14,
"title": "An image",
"jpeg": {
"url": "/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg",
"full_url": "https://nationalarchives.gov.uk/media/images/example.2e16d0ba.fill-600x400.format-jpeg.jpegquality-60.jpg",
"width": 100,
"height": 68
},
"webp": {
"url": "/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-80.webp",
"full_url": "https://nationalarchives.gov.uk/media/images/exampl.2e16d0ba.fill-600x400.format-webp.webpquality-80.webp",
"width": 100,
"height": 68
}
},
"is_newly_published": true
}
]
},
"id": "f3544bb7-11e1-4894-9e9d-02ada7409600"
}
]
}
Loading

0 comments on commit 13b5d83

Please sign in to comment.