Hi,

First of all, apologize me for my poor, poor english.

I m new with django and i m stuck with a odd thing.

I created a login form and use the default django login handlet like
this :

base.html :
(...)                   {% if user.is_authenticated %}
                                <a href="#">{{user.username }}</a>
                        {% else %}
                                <a href="{% url django.contrib.auth.views.login 
%}?
next={{request.path}}">Login</a>
                        {% endif %}
                        <a href="/accounts/logout/">log out</a
(...)
login.html :
{% extends "base.html" %}

{% block content %}

{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}

<form method="post" action='.'>
{% 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={{request.path}} />
</form>
{% endblock %}


The problem is : when i m in login.html i see my user.username, but
when i submit the login form and being redirect to index i don t
retrieve the user.username.
I add in my views.py this import :
from django.template import Context, loader, RequestContext
from empireFront.models import Video
from django.http import HttpResponse
from django.contrib import auth
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect
from django.contrib.sessions.models import Session

I heard something about use render_to_response but when, where and
how ?

Thx for your help !



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to