Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working with Django, HTML and CSS.

When using
<a href='link' target="_blank">www.supportline.org.uk/problems/suicide/</a>
in my HTML file to open a link on my web page I have no problems. However when inserting this link into a JSON text file i end up with the following:

127.0.0.1:8000/chatbotModel/anxiety/www.supportline.org.uk/problems/suicide/


Does this mean that i will need to manually add this somehow in the urls.py?

What I have tried:

in main urls.py:

urlpatterns = [
    path('admin/', admin.site.urls),
    path('chatbotModel/', include('chatbotModel.urls')),

]



in app urls.py

urlpatterns = [
    path('anxiety/', views.say_hello, name='say_hello'),
    path('getResponse/', views.getResponse, name = 'getResponse'),
    path('suicidePrevention/', views.suicidePrevention, name = 'suicidePrevention')
]


in views.py

def suicidePrevention(request):
    return HttpResponse('suicidePrevention')



Am i heading in the right direction?
Posted
Updated 21-Jul-21 5:32am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900