Login through dropdown menu in Django
<p>I have struggle with django's login. So i want user to login through my dropdown menu, but my LoginForm doesnt show up. I dunno  what to do</p>

<p><strong>forms.py</strong></p>

<pre><code>class LoginForm(forms.Form):
    username = forms.CharField(label=(u'Username'),widget = forms.TextInput(attrs = {'placeholder': 'Username'}))
    password = forms.CharField(max_length=16, label=(u'Password'), 
    widget = forms.PasswordInput(attrs = {'placeholder': 'Password (min 8 chrct)'}, render_value = False),
    validators=[MinLengthValidator(8, message = 'Password must be at least 8 characters')])
</code></pre>

<p><strong>views.py</strong></p>

<pre><code>def LoginRequest(request):
if request.user.is_authenticated():
    return HttpResponseRedirect('/profile/')
if request.method == 'POST':
    form = LoginForm(request.POST)
    if form.is_valid():
        username = form.cleaned_data['username']
        password = form.cleaned_data['password']
        tutor = authenticate(username=username, password=password)
        if tutor is not None:
            login(request, tutor)
            return HttpResponseRedirect('/profile/')
        else:
            return render_to_response('/', {'form': form}, context_instance=RequestContext(request))
    else:
        return render_to_response('/', {'form': form}, context_instance=RequestContext(request))
else:
    form = LoginForm()
    context = {'form': form}
    return render_to_response('/', {'form': form}, context_instance=RequestContext(request))
</code></pre>

<p><strong>navbar.html</strong></p>

<pre><code>&lt;a class="dropdown-toggle" href="#" data-toggle="dropdown"&gt;Login &lt;strong class="caret"&gt;&lt;/strong&gt;&lt;/a&gt;
        &lt;div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;"&gt;
            &lt;form action="" method="POST"&gt;
            {% csrf_token %}
                {% if form.errors %}
                    {{ form.errors}}
                {% endif %}
               {{form}}
                &lt;input class="btn btn-primary" type="submit" value="Login" /&gt;

            &lt;/form&gt;
        &lt;/div&gt;
</code></pre>