0

django ERR_CONNECTION_REFUSED

I'm trying django framework these days and I am facing this error described above. I have an app in the project called products and it has views.py module with this code inside: from django.http import HttpResponse def index(request): return HttpResponse("Hello World") and another file urls.py in the same directory with the following code: from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index') ] and also the root urls.py file in the project : from django.contrib import admin from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), path('products/', include('products.urls')), ] all of this as I checked from Django documentation should work but the result is ERR_CONNECTION_REFUSED when I try to access the directory using the server. if you have any experience in Django, please help.

14th Apr 2020, 5:46 PM
Saeed Alqassabi
Saeed Alqassabi - avatar
2 Réponses
+ 1
Thanks for the help, I just solved it , I restarted the server and it worked.
14th Apr 2020, 6:24 PM
Saeed Alqassabi
Saeed Alqassabi - avatar
+ 1
No it still the same problem.
14th Apr 2020, 6:05 PM
Saeed Alqassabi
Saeed Alqassabi - avatar