Checking if user is logged in and log in form

1 view
Skip to first unread message

AKK

unread,
Jul 19, 2009, 5:31:31 PM7/19/09
to Django users
Hi, i have a login form using the generic view like so:

(r'^accounts/login/$', 'django.contrib.auth.views.login',
{'template_name': 'blogSite/login.html'}),

but i only want the form to show up if your not logged in, but since
its is a generic view how can i use

if not request.user.is_authenticated():

as well as the view and also pass the template name.

Thanks

Ryan K

unread,
Jul 19, 2009, 8:25:02 PM7/19/09
to Django users
> urlpatterns = patterns('',
> (r'^someurl/', login_required(direct_to_template), { 'template':
> 'template.html', }),
> )

http://groups.google.com/group/django-users/browse_thread/thread/e9f85ce0666da8c/

Cheers,
Ryan
http://consulting.ryankaskel.com
Reply all
Reply to author
Forward
0 new messages