On Wed, Feb 2, 2011 at 5:24 AM, Derek <gamesb...@gmail.com> wrote:

> I need to handle a call to the root url for a site more elegantly than my
> current.
>
> At the moment I have:
>
> #urls.py
>     (r'^$', 'myproj.myapp.views.root'),
>     #and
>     (r'^admin/', include(admin.site.urls)),
>
> #views.py
> def root(request):
>     """Handle a call to the / (root) URL address"""
>     return redirect('/admin/')
>
> This works, but the extra "admin/" that has been added sticks out like a
> sore thumb on address bar the main page (which doubles as the login page).
>

If you want the admin app accessible from root, then put it there.
admin.site.urls does not have to be placed at r'^admin/', you can change
that to r'' (and get rid of your r'^$' entry), then you will have admin app
at root of your site with no admin prefix on the admin urls.

Karen
-- 
http://tracey.org/kmt/

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