The view TrailDB.views.basic didn't return an HttpResponse object. It returned None instead.

I am Learning Python and Django. In my trail project, I created a model form and it works perfectly. then I tried to create next model in the same file and trying to run. it always gives the same error “The view TrailDB.views.basic didn’t return an HttpResponse object. It returned None instead.”

The following is the codes i am using for the particular model.

def basic(request):
if request.method == “POST”:
bas = forms.Basic_Details_Data(request.POST)
if bas.is_valid():
Basic_D = models.Basic_Details(title=request.POST[‘title’],
return redirect(’/TrailDB/display’)
bas = forms.Basic_Details_Data()
return render(request, ‘display.html’, {‘bas’: bas})

Please advise…

When you’re posting code here, enclose the code between lines of three backtick - ` characters. That means you’ll have a line of ```, then your code, then another line of ```. That forces the forum software to keep your code properly formatted, which is critical with Python.
In this case, you don’t need to repost your code. You can edit your original post to put ``` on the line before your code and another line of ``` after it.
Otherwise, we can’t tell if your code is properly indented.