Skip to content

Commit bf4f7e1

Browse files
committed
Changed 'submitLink' destination to 'home' when submitting a link and removed submitLink
1 parent 91309df commit bf4f7e1

File tree

5 files changed

+18
-175
lines changed

5 files changed

+18
-175
lines changed

db.sqlite3

0 Bytes
Binary file not shown.

nobiasapp/templates/newPage.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ <h1>NoBias</h1>
228228
<p>NoBias is a program that will detect bias in a news article. We will detect bias by analyzing the tone,
229229
sentiment, and diction of a news article.</p>
230230
</div>
231-
<form method="post" action="{% url 'submitLink' %}" onsubmit="showLoader()"
231+
<form method="post" action="{% url 'home' %}" onsubmit="showLoader()"
232232
style="display: flex; flex-direction: column; align-items: center; padding: 20px; margin-top: 70px;">
233233

234234
{% csrf_token %}

nobiasapp/templates/submitLink.html

-157
This file was deleted.

nobiasapp/urls.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from django.urls import path
22

33
from . import views
4-
from .views import submitLink
4+
# from .views import submitLink
55
urlpatterns = [
66
path("aboutus", views.aboutus, name="aboutus"),
7-
path('submitLink', submitLink, name='submitLink'),
7+
# path('submitLink', submitLink, name='submitLink'),
88
path("tech", views.tech, name="tech"),
99
path('home', views.home, name="home")
1010
]

nobiasapp/views.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
from nlpFiles.getTextFromWeb import polarityRating, highRatedSent
33
from .forms import SubmitLinkForm
44

5-
def submitLink(request):
6-
if request.method == 'POST':
7-
form = SubmitLinkForm(request.POST)
8-
if form.is_valid():
9-
link_object = form.save() # This saves the link to the database
10-
thisVar = link_object.link # Access the link and store it in thisVar
11-
# You can now use thisVar for other Python code
12-
paragraph = []
13-
polarityRating(paragraph, thisVar)
14-
highValuedList = highRatedSent(paragraph)
15-
# Redirect or render a success page
16-
return render(request, 'successPage.html', {'thisVar': paragraph, "highValuedList": highValuedList})
17-
else:
18-
form = SubmitLinkForm()
5+
# def submitLink(request):
6+
# if request.method == 'POST':
7+
# form = SubmitLinkForm(request.POST)
8+
# if form.is_valid():
9+
# link_object = form.save() # This saves the link to the database
10+
# thisVar = link_object.link # Access the link and store it in thisVar
11+
# # You can now use thisVar for other Python code
12+
# paragraph = []
13+
# polarityRating(paragraph, thisVar)
14+
# highValuedList = highRatedSent(paragraph)
15+
# # Redirect or render a success page
16+
# return render(request, 'successPage.html', {'thisVar': paragraph, "highValuedList": highValuedList})
17+
# else:
18+
# form = SubmitLinkForm()
1919

20-
return render(request, 'submitLink.html', {'form': form})
20+
# return render(request, 'submitLink.html', {'form': form})
2121

2222
def aboutus(request):
2323
return render(request, 'aboutus.html')

0 commit comments

Comments
 (0)