Get Gemini working again

This commit is contained in:
Matthias 2021-06-25 07:22:48 +00:00
parent 58ace6ccaf
commit 0de66e124f
3 changed files with 9 additions and 3 deletions

View File

@ -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()

View File

@ -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 %}

View File

@ -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: