Re: Changing Login Page for Admin

2008-08-25 Thread Tim Sawyer

On Sunday 24 Aug 2008, Tim Sawyer wrote:
> Hi,
>
> I'm using the newforms admin stuff, and I'd like to use my own URL for the
> login page for the admin site.
>
> So, if someone goes to /admin on my site (which is where the admin site is
> located), I'd like to redirect to /private/login/?next=/admin.
>
> (The reason I want to do that is that I have some custom code on the login
> that looks for and removes a suffix before passing through to the user
> authentication code.)
>
> Is this straightforward?

Probably not the neatest solution, but it works.

1) in urls.py, set the login template after autodiscover:

admin.autodiscover()
admin.site.login_template = 'registration/login_redirect.html'

In the registration/login_redirect.html template, redirect to the login page 
you want:








Tim.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Changing Login Page for Admin

2008-08-24 Thread Tim Sawyer

Hi,

I'm using the newforms admin stuff, and I'd like to use my own URL for the 
login page for the admin site.

So, if someone goes to /admin on my site (which is where the admin site is 
located), I'd like to redirect to /private/login/?next=/admin.

(The reason I want to do that is that I have some custom code on the login 
that looks for and removes a suffix before passing through to the user 
authentication code.)

Is this straightforward?

Thanks,

Tim.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---