Hello everybody!

I am try to add registration in my django site., I am using
django.contrib.auth.views.login via django-registration and I have set
the next="/home_page/" param in the login form. The view asociated to /
home_page/ is excuted, its return looks like this:

return render_to_response('myapp/shop_list.html',
                        {'shop': entry_list,},
                        context_instance=RequestContext(request))

I didnt render any other template between login and this view but,
while debugging, I've realized that the User is not in the request
before this return so the template recieves an AnonymousUser and
user.is_authenticated() returns False

The user is in the DDBB and the password is correct. Cookies are
enabled for Firefox and Chrome. How can I get the logged User at this
point?

Here is some information about my app that may be helpful:

settings.py
===========

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.contrib.auth.context_processors.auth',
    'django.core.context_processors.debug',
    'django.core.context_processors.i18n',
    'django.core.context_processors.media',
    'django.contrib.messages.context_processors.messages',
    'django.core.context_processors.request',
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'myapp',
    'registration',
    'django.contrib.admin',
)

login.html
==========

{% block maincontent %}
<form method="post" action="">{% csrf_token %}
    {{form.as_p}}
    <input name="next" type="hidden" value="/home_page/" />
    <input type="submit" value="Login">
</form>
{% endblock %}

link to login
=============

<a href="{% url django.contrib.auth.views.login %}">Login</a>

-- 
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