Entirely new to python and django framework.

Trying to build a login/registration system.'

After registering, redirects to home but user is not authenticated (returns false always)

**views.py**

```
def register(request):
if request.method == 'POST':
    form = SignUpForm(request.POST)
    if form.is_valid():
        form.save()
        username = form.cleaned_data.get('username')
        fullname = form.cleaned_data.get('fullname')
        password = form.cleaned_data.get('password1')
        user = authenticate(username=username, fullname=fullname, password=password)
        messages.success(request, f'Welcome to blaza {fullname}')
        if user is not None:
            login(request, user)
        return redirect('home')
else:
    form = SignUpForm()

return render(request, 'accounts/signup.html', {'form': form})

```

**home.html**

```
{% extends 'base.html' %}
{% block title %} Home {% endblock %}
{% block content %}
{% if user.is_authenticated %}
Welcome, {{user.username}}!
<a href="">Logout</a>
{% else %}
<P>You are not logged in</P>
<p><a href="">Login here</a></p>
{% endif %}  
{% endblock %}

```

It returns false always. "You are not logged".

I have tried *{% if request.user.is\_authenticated %}* still not working.