Django - get to home page only through login/signup : Guys help please, I am completely confused. My task is to get home page view only after login/signup action. For exapmple, if we go to example.com we should get login page. And if we are not registrated before then pushing Login button (after entering any username and password because at the moment I have not done yet Signup button) have to move us at signup page.

Here the code is - http://pastebin.com/e5LCJmgH

And this is my login.html:

    {% load staticfiles %}
    
    {% if form.errors %}
    <p>Your username and password didn't match. Please try again.</p>
    {% endif %}
    
    {% if next %}
        {% if user.is_authenticated %}
        <p>Your account doesn't have access to this page. To proceed,
        please login with an account that has access.</p>
        {% else %}
        <p>Please login to see this page.</p>
        {% endif %}
    {% endif %}
    
    <form method="post" action="{% url 'my_login' %}">
    {% csrf_token %}
    <table>
    <tr>
        <td>{{ form.username.label_tag }}</td>
        <td>{{ form.username }}</td>
    </tr>
    <tr>
        <td>{{ form.password.label_tag }}</td>
        <td>{{ form.password }}</td>
    </tr>
    </table>
    
    <input type="submit" value="Login" />
    <input type="hidden" name="next" value="{{ next }}" />
    </form>

Currently the error is shown (after hiting Login button) - ValueError at /login/
The view evr.views.my_login didn't return an HttpResponse object. It returned None instead.

But the point is not only about this error. I am just do not uderstand in general if my direction is right or not?

Thanks! 