Issue
i am trying to run manage.py runserver on pycharm and an attribute error is returned
File "C:\Users\user\PycharmProjects\Diabetes Prediction\Diabetes_prediction\Diabetes_Prediction\urls.py", line 23, in <mod
ule>
path("", views.home),
^^^^^^^^^^
AttributeError: module 'Diabetes_Prediction.views' has no attribute 'home'
I expected the project to run
Solution
This typically means that there is no 'home' function or class inside your views module.
To resolve this issue, you should check the Diabetes_Prediction/views.py file and ensure that it contains a function or class named 'home'. Here's a general example of what your views.py might look like:
# Diabetes_Prediction/views.py
from django.shortcuts import render
def home(request):
# Your view logic goes here
return render(request, 'home.html') # Adjust the template name as needed
Hope it will help you out.
Answered By - Kapil gaikwad
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.