diff --git a/.gitignore b/.gitignore index 101b28c..055fb3c 100644 --- a/.gitignore +++ b/.gitignore @@ -62,4 +62,7 @@ target/ .idea/ # MacOS -*.DS_Store \ No newline at end of file +*.DS_Store + +# A scratch pad file you will not want to upload to the repo +NOTES.md \ No newline at end of file diff --git a/README.md b/README.md index 524d007..bffb1e2 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ echo "mysecret" | docker secret create - To test the build locally on your laptop: -`docker run -it --name datasketch_cms -e DB_HOST="host.docker.internal" -p 8888:8000 androiddrew/datasketch:latest` +`docker run -it --name datasketch_cms -e DB_HOST="host.docker.internal" -e DB_PORT=5432 -p 8888:5000 androiddrew/datasketch: gunicorn cms.wsgi:application --bind 0.0.0.0:5000 --workers 3` If using the postgres.app on Mac OS you will need to update both the postgresql.conf and pg_hba.conf files diff --git a/docker-compose-swarm.yml b/docker-compose-swarm.yml index 0bd5bb6..9bd4e4f 100644 --- a/docker-compose-swarm.yml +++ b/docker-compose-swarm.yml @@ -3,7 +3,7 @@ version: '3.6' services: cms: - image: androiddrew/datasketch:0.1.3 + image: androiddrew/datasketch:0.1.4 command: gunicorn cms.wsgi:application --bind 0.0.0.0:5000 --workers 3 deploy: replicas: 1 diff --git a/services/cms/.dockerignore b/services/cms/.dockerignore new file mode 100644 index 0000000..35d2cd2 --- /dev/null +++ b/services/cms/.dockerignore @@ -0,0 +1,2 @@ +env/ +README.md diff --git a/services/cms/Dockerfile b/services/cms/Dockerfile index 6c3c55c..7bcb37e 100644 --- a/services/cms/Dockerfile +++ b/services/cms/Dockerfile @@ -1,5 +1,5 @@ #FROM python:3.7-alpine -FROM python:3.7 +FROM python:3.7-slim LABEL maintainer="drew@androiddrew.comw" # Set environmental variables diff --git a/services/cms/home/migrations/0003_homepage_body.py b/services/cms/home/migrations/0003_homepage_body.py new file mode 100644 index 0000000..245974e --- /dev/null +++ b/services/cms/home/migrations/0003_homepage_body.py @@ -0,0 +1,17 @@ +# Generated by Django 2.1.2 on 2018-11-10 21:18 + +from django.db import migrations +import wagtail.core.fields + + +class Migration(migrations.Migration): + + dependencies = [("home", "0002_create_homepage")] + + operations = [ + migrations.AddField( + model_name="homepage", + name="body", + field=wagtail.core.fields.RichTextField(blank=True), + ) + ] diff --git a/services/cms/home/models.py b/services/cms/home/models.py index af7b579..a46fa1e 100644 --- a/services/cms/home/models.py +++ b/services/cms/home/models.py @@ -1,7 +1,11 @@ from django.db import models from wagtail.core.models import Page +from wagtail.core.fields import RichTextField +from wagtail.admin.edit_handlers import FieldPanel class HomePage(Page): - pass + body = RichTextField(blank=True) + + content_panels = Page.content_panels + [FieldPanel("body", classname="full")] diff --git a/services/cms/home/templates/home/home_page.html b/services/cms/home/templates/home/home_page.html index a775ecb..968c6ff 100644 --- a/services/cms/home/templates/home/home_page.html +++ b/services/cms/home/templates/home/home_page.html @@ -1,7 +1,10 @@ {% extends "base.html" %} +{% load wagtailcore_tags %} + {% block body_class %}helvetica{% endblock %} {% block content %}

Welcome to Datasketch.io!

+ {{ page.body|richtext }} {% endblock %}