Posts

Showing posts with the label django-views

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

The view didn't return an HttpResponse object. It returned None instead I have the following simple view. Why is it resulting in this error? The view auth_lifecycle.views.user_profile didn't return an HttpResponse object. It returned None instead. The view auth_lifecycle.views.user_profile didn't return an HttpResponse object. It returned None instead. """Renders web pages for the user-authentication-lifecycle project.""" from django.shortcuts import render from django.template import RequestContext from django.contrib.auth import authenticate, login def user_profile(request): """Displays information unique to the logged-in user.""" user = authenticate(username='superuserusername', password='sueruserpassword') login(request, user) render(request, 'auth_lifecycle/user_profile.html', context_instance=RequestContext(request)) ...

NoReverseMatch Django url issue

NoReverseMatch Django url issue I am trying to implement a typical url in my django project however i keep getting the error meassage. I have checked my urls, views and html code where i have passed in the KWARGS. I have no clue what went wrong here please help? The home.html uses user_profile_detail in the template userprofile/home.html <div class="sidebar-fixed position-fixed side_nav_bar "> <a class="logo-wrapper waves-effect"> <img src="/" class="img-fluid" alt=""> </a> <div class="list-group list-group-flush"> **<a href="{% url 'userprofile:dashboard' user_profile_detail.slug %}" class="list-group-item {% if request.path == dashboard %}active{% endif %} waves-effect"> <i class="fa fa-pie-chart mr-3"></i>Dashboard </a>** <a href="{% url 'userprofile:profile' use...