diff --git a/docker-compose-swarm.yml b/docker-compose-swarm.yml index 9bd4e4f..0ef6330 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.4 + image: androiddrew/datasketch:0.2.1 command: gunicorn cms.wsgi:application --bind 0.0.0.0:5000 --workers 3 deploy: replicas: 1 diff --git a/services/cms/blog/templates/blog/blog_page.html b/services/cms/blog/templates/blog/blog_page.html index 65b4152..e6eaf9b 100644 --- a/services/cms/blog/templates/blog/blog_page.html +++ b/services/cms/blog/templates/blog/blog_page.html @@ -6,7 +6,7 @@ {% block content %} {% include 'header.html' %} -
+

{{ page.title }}

{{ page.date }}

{% if page.tags.all.count %} @@ -19,12 +19,24 @@ {{ page.body|richtext }} - {% for item in page.gallery_images.all %} -
- {% image item.image fill-320x240 %} -

{{ item.caption }}

-
- {% endfor %}
+
+ + {% endblock %} \ No newline at end of file diff --git a/services/cms/cms/context_processors.py b/services/cms/cms/context_processors.py new file mode 100644 index 0000000..8f5b143 --- /dev/null +++ b/services/cms/cms/context_processors.py @@ -0,0 +1,7 @@ +from django.conf import settings + + +def commenting(context): + """Template context processor used to check if a COMMENTING setting is True""" + return {"commenting": settings.COMMENTING} + diff --git a/services/cms/cms/settings/base.py b/services/cms/cms/settings/base.py index ac5d375..94033ce 100644 --- a/services/cms/cms/settings/base.py +++ b/services/cms/cms/settings/base.py @@ -16,7 +16,6 @@ import os PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) BASE_DIR = os.path.dirname(PROJECT_DIR) - # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ @@ -73,6 +72,7 @@ TEMPLATES = [ "django.template.context_processors.request", "django.contrib.auth.context_processors.auth", "django.contrib.messages.context_processors.messages", + "cms.context_processors.commenting" ] }, } @@ -80,7 +80,6 @@ TEMPLATES = [ WSGI_APPLICATION = "cms.wsgi.application" - # Database # https://docs.djangoproject.com/en/2.1/ref/settings/#databases @@ -104,7 +103,6 @@ AUTH_PASSWORD_VALIDATORS = [ {"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"}, ] - # Internationalization # https://docs.djangoproject.com/en/2.1/topics/i18n/ @@ -118,7 +116,6 @@ USE_L10N = True USE_TZ = True - # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.1/howto/static-files/ @@ -140,7 +137,6 @@ STATIC_URL = "/static/" MEDIA_ROOT = os.path.join(BASE_DIR, "media") MEDIA_URL = "/media/" - # Wagtail settings WAGTAIL_SITE_NAME = "datasketch.io" @@ -148,3 +144,10 @@ WAGTAIL_SITE_NAME = "datasketch.io" # 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 BASE_URL = "https://datasketch.io" + +INTERNAL_IPS = [ + '127.0.0.1', +] + +# Disqus comment integration +COMMENTING = False \ No newline at end of file diff --git a/services/cms/cms/settings/dev.py b/services/cms/cms/settings/dev.py index ace826a..cca92de 100644 --- a/services/cms/cms/settings/dev.py +++ b/services/cms/cms/settings/dev.py @@ -22,6 +22,8 @@ DATABASES = { } } +COMMENTING = False + try: from .local import * except ImportError: diff --git a/services/cms/cms/settings/production.py b/services/cms/cms/settings/production.py index 3436e0d..bddbd31 100644 --- a/services/cms/cms/settings/production.py +++ b/services/cms/cms/settings/production.py @@ -40,6 +40,8 @@ LOGGING = { }, } +COMMENTING = True + try: from .local import *