diff --git a/jetforce_app.py b/jetforce_app.py index c45249a..4298301 100644 --- a/jetforce_app.py +++ b/jetforce_app.py @@ -12,6 +12,8 @@ from main.models import Thought from jetforce import GeminiServer, JetforceApplication, Response, Status +from decouple import config + app = JetforceApplication() @app.route("", strict_trailing_slash=False) @@ -42,6 +44,9 @@ def about(request): if __name__ == "__main__": server = GeminiServer( app=app, - host=settings.ALLOWED_HOSTS[0] + host="0.0.0.0", + hostname=("localhost" if settings.DEBUG else settings.ALLOWED_HOSTS[0]), + certfile=config("CERTFILE", default=None), + keyfile=config("KEYFILE", default=None) ) server.run() diff --git a/main/templates/whispermaphone/index.gmi b/main/templates/whispermaphone/index.gmi index 5a33b4b..2cef3b7 100644 --- a/main/templates/whispermaphone/index.gmi +++ b/main/templates/whispermaphone/index.gmi @@ -1,7 +1,8 @@ # Thoughts {% for thought in thoughts %}{{ thought.text|safe }} {% if thought.extended_text %} -{{ thought.extended_text|safe }}{% endif %}{% if thought.media %} +{{ thought.extended_text|safe }} +{% endif %}{% if thought.media %} => https://thoughts.learnerpages.com{{ thought.media.url }}{% endif %}{% load tz %} ``` {% timezone thought.timezone %}{{ thought.posted|time:"g:i a" }} {{ thought.posted|date:"M d, Y" }}, UTC{{ thought.offset_hours }}{% endtimezone %} diff --git a/whispermaphone/settings.py b/whispermaphone/settings.py index 3337d12..dea3e4c 100644 --- a/whispermaphone/settings.py +++ b/whispermaphone/settings.py @@ -24,7 +24,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = config("SECRET_KEY", default="qdm4_0b)3^)k$6r($!o^a7&0l#^6)@g2wr!x0r40ii@9otfnwo") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = config("DEBUG", default=True) +DEBUG = config("DEBUG", default=True, cast=bool) ALLOWED_HOSTS = ["thoughts.learnerpages.com"] if DEBUG: