diff --git a/epb_site/gemini.py b/epb_site/gemini.py index ce1880b..15358bd 100644 --- a/epb_site/gemini.py +++ b/epb_site/gemini.py @@ -37,7 +37,7 @@ chat_session = model.start_chat( ] ) -# print(chat_session.send_message("hello world!").text) +print(chat_session.send_message("hello world!").text) diff --git a/epb_site/models.py b/epb_site/models.py index f3d18a5..304507f 100644 --- a/epb_site/models.py +++ b/epb_site/models.py @@ -1,4 +1,7 @@ from django import forms class Statement(forms.Form): - input = forms.CharField(required=True) + input = forms.CharField(required=True, label='') + +class Reset(forms.Form): + input = "__reset__" diff --git a/epb_site/templates/home.html b/epb_site/templates/home.html index 969211e..f08fcee 100644 --- a/epb_site/templates/home.html +++ b/epb_site/templates/home.html @@ -29,8 +29,16 @@ {{ form.as_p }} - + + + {{ points }} - \ No newline at end of file diff --git a/epb_site/views.py b/epb_site/views.py index 3561dd4..d4d452e 100644 --- a/epb_site/views.py +++ b/epb_site/views.py @@ -1,8 +1,10 @@ # appname/views.py from django.shortcuts import render from django.http import HttpResponse -from .models import Statement -from django.shortcuts import redirect +from django.template.defaultfilters import title +from django.utils.termcolors import RESET + +from .models import * from . import gemini import markdown @@ -12,13 +14,12 @@ def home(request): md = markdown.Markdown() response = md.convert(response) - # formatted_response = re.sub('\*\*', r'\n\n', response) - form = Statement() + reset_button = Reset() return render(request, 'home.html', {'form': form, 'response': response}) else: form = Statement() - return render(request, 'home.html', {'form': form, 'response': 'Enter some basic data to begin:'}) + return render(request, 'home.html', {'form': form, 'title': 'Enter data', 'response': 'Enter some basic data to begin:'}) def about(request): return HttpResponse("This is the about page")