Wednesday, February 2, 2011

Re: Django Project - handling call to the "root" url?

On Wed, Feb 2, 2011 at 2:35 PM, Derek <gamesbook@gmail.com> wrote:
> Tom
> Restated thusly:
> 1. I want the "/" to display the login form (and not append 'admin/' to the
> visible URL)
> 2. I want the login form (which I have coded) to work as normal
> 3. I want the rest of admin to work with the 'admin/' portion (prepended as
> normal)
> I am not sure how else to describe this... what is not clear?

TBH, this is the first time that you have elucidated your
requirements! Iit certainly wasn't clear you have a custom login form.

Where have you hooked this up to? Are you using
django.contrib.auth.views.login [1] to render this form?

How about this:

def root(request):
from django.contrib.auth.views import login
return login(request, 'my_template_name.html')

Refer to the docs if that doesn't work, I'm making many assumptions
about how you have configured your project. The link in [1] is
specifically about the login view, but the rest of that page is
concise and clear about how to hook up authentication into your
project.

Cheers

Tom

[1] http://docs.djangoproject.com/en/1.2/topics/auth/#django.contrib.auth.views.login

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment