From 573b6e8b1186ba19f2937d078445e7f2f33b26b7 Mon Sep 17 00:00:00 2001 From: gowtham1729 Date: Thu, 14 Dec 2023 00:27:15 +0900 Subject: [PATCH] feat: Add bootstrap UI --- .../django_server/django_server/settings.py | 8 +- .../django_server/news/templates/base.html | 112 ++++++++++++++++++ .../django_server/news/templates/home.html | 13 +- .../django_server/news/templates/news.html | 48 ++++++-- .../backend/django_server/news/urls.py | 4 +- 5 files changed, 160 insertions(+), 25 deletions(-) create mode 100644 applications/backend/django_server/news/templates/base.html diff --git a/applications/backend/django_server/django_server/settings.py b/applications/backend/django_server/django_server/settings.py index 7d081b6..8352a2e 100644 --- a/applications/backend/django_server/django_server/settings.py +++ b/applications/backend/django_server/django_server/settings.py @@ -38,10 +38,10 @@ SECRET_KEY = DJANGO_SECRET_KEY # SECURITY WARNING: don't run with debug turned on in production! -if ENV != "local": - DEBUG = False -else: - DEBUG = True +# if ENV != "local": +# DEBUG = False +# else: +DEBUG = True # FORCE_SCRIPT_NAME = "/api" ALLOWED_HOSTS = ["*"] diff --git a/applications/backend/django_server/news/templates/base.html b/applications/backend/django_server/news/templates/base.html new file mode 100644 index 0000000..6a361ca --- /dev/null +++ b/applications/backend/django_server/news/templates/base.html @@ -0,0 +1,112 @@ + + + + + + Folio Feed + + + + + +
+ + +
+{% block content %} +{% endblock %} + + + + \ No newline at end of file diff --git a/applications/backend/django_server/news/templates/home.html b/applications/backend/django_server/news/templates/home.html index 9aac75b..bf15245 100644 --- a/applications/backend/django_server/news/templates/home.html +++ b/applications/backend/django_server/news/templates/home.html @@ -1,9 +1,6 @@ - - - - Folio Feed - - +{% extends 'base.html' %} + +{% block content %}

Folio Feed

Your Tickers:

@@ -29,5 +26,5 @@

{{ analysis.symbol }}Number of Neutral Articles: {{ analysis.neutral_news }}

Need Attention: {{analysis.need_attention}}

{% endfor %} - - + +{% endblock %} diff --git a/applications/backend/django_server/news/templates/news.html b/applications/backend/django_server/news/templates/news.html index e640eaf..f535fbf 100644 --- a/applications/backend/django_server/news/templates/news.html +++ b/applications/backend/django_server/news/templates/news.html @@ -1,11 +1,37 @@ -

{{symbol}} on {{date}}

- -{% for item in news %} -

{{item.headline}}

- -

{{item.summary}}

-

Source: {{item.src}}

-

Sentiment: {{item.sentiment}}

-

Need Attention: {{item.need_attention}}

-

Why ? {{item.reason}}

-{% endfor %} \ No newline at end of file +{% extends "base.html" %} + +{% block content %} +
+
+
+

{{date}}: {{symbol}}

+

+
+
+
+ +
+
+
+ {% for item in news %} +
+
+ + {{ item.headline }} + +
+

{{ item.summary }}

+
+ - {{ item.src }} + {{ item.publish_time }} +
+
+
+
+ {% endfor %} + +
+
+
+{% endblock %} \ No newline at end of file diff --git a/applications/backend/django_server/news/urls.py b/applications/backend/django_server/news/urls.py index af1810e..6a3831d 100644 --- a/applications/backend/django_server/news/urls.py +++ b/applications/backend/django_server/news/urls.py @@ -11,6 +11,6 @@ urlpatterns = [ # path("", views.index, name="main_index"), path("api/", include(router.urls)), - path("home", views.home, name="home"), - path("news//", views.news, name="news"), + path("", views.home, name="home"), + path("/", views.news, name="news"), ]