Django is not responding file

I am writing basic views and then putting it in but it is still not working.
[from django.shortcuts import render
from django.http import HttpResponse

def home(request):
    return HttpResponse("hello how are you")

from django.contrib import admin
from django.urls import path,include
urlpatterns = [

from django.urls import path
from . import views
urlpatterns = [

I have also included my app in settings of project (Installed apps).

Some thoughts about that:

Change your urls patterns in your apps urls to:

from .views import *
urlpatterns= [
    path('', home,name='home')

If its not working send us your installed apps settings and wsgi file

You confused, you need to write not only with your current code.

If you want the view to be rendered in default route so change as:

from . import views

urlpatterns= [
    path('', views.home,name='home')

Otherwise, you can only append /home with your current code to work.

for the same code above it is working for the URL

Back to Top