From f3c7e67e79fed77e7369f536e5f833f578d59d73 Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 15 Oct 2019 14:22:26 +0200 Subject: [PATCH] Adds HTML to content styles --- news/choices.py | 3 ++- news/templates/news/index.html | 15 +++++++++++++++ pokercc/settings.py | 19 +++++++++---------- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/news/choices.py b/news/choices.py index 92fc064..af332e8 100644 --- a/news/choices.py +++ b/news/choices.py @@ -2,5 +2,6 @@ STYLE_CHOICES = ( (0, "Standard [Title + URL + Image]"), (1, "Quote [Title]"), (2, "Image Only [Image]"), - (3, "Youtube [Put video id in URL]") + (3, "Youtube [Put video id in URL]"), + (4, "HTML [Title + Body(HTML)]") ) diff --git a/news/templates/news/index.html b/news/templates/news/index.html index c7afae7..1cfa0f9 100644 --- a/news/templates/news/index.html +++ b/news/templates/news/index.html @@ -92,6 +92,21 @@ +
+ + +
+ {% for comment in post.top_comments %} + {{ comment.body }} - {{ comment.author.username }}
+ {% endfor %} +
+
+ {% elif post.style == 4 %} + + {{ post.body |safe }} +
{% if post.comment_set.count > 0 %}{{ post.comment_set.count }} comment{% if post.comment_set.count > 1 %}s{% endif %}{% else %}write comment{% endif %} diff --git a/pokercc/settings.py b/pokercc/settings.py index fbd9485..1d8c154 100644 --- a/pokercc/settings.py +++ b/pokercc/settings.py @@ -27,7 +27,7 @@ SECRET_KEY = 'erk4wh93pi(m(odwg74lsy60tb$rz4=ndyiv3#2lcx^!$^kq@4' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = ['ssh-stax.alwaysdata.net', 'www.pokerrumble.net'] +ALLOWED_HOSTS = ['127.0.0.1', 'ssh-stax.alwaysdata.net', 'www.pokerrumble.net'] #EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' @@ -86,15 +86,14 @@ WSGI_APPLICATION = 'pokercc.wsgi.application' DATABASES = { 'default': { - # 'ENGINE': 'django.db.backends.sqlite3', - # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'stax_rumble_dev', - 'USER': 'stax', - 'PASSWORD': 'staxkikoo', - 'HOST': 'postgresql-stax.alwaysdata.net', - # 'PORT': '5432', + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + + # 'ENGINE': 'django.db.backends.postgresql', + # 'NAME': 'stax_rumble_dev', + # 'USER': 'stax', + # 'PASSWORD': 'staxkikoo', + # 'HOST': 'postgresql-stax.alwaysdata.net', } }