On Nov 18, 2009, at 6:06 AM, Zeynel wrote:

> I've been trying to redirect
> 
> /admin/ to /admin/wkw1/lawyer
> 
> The suggestions from my previous post 
> http://groups.google.com/group/django-users/msg/67c4594a4083bd45
> did not work.
> 
> I read the redirect section in the documents as suggested
> 
> http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-simple-redirect-to
> 
> and tried this urls.py
> 
> from django.conf.urls.defaults import *
> from django.contrib import admin
> admin.autodiscover()
> 
> urlpatterns = patterns('',
>    (r'^wkw1/$', 'sw1.wkw1.views.index'),
> #    (r'^admin/', include(admin.site.urls)),
> )
> 
> urlpatterns += patterns('django.views.generic.simple',
>   ('^admin/$', 'redirect_to', {'url': '/admin/wkw1/lawyer/'}),
>   )
> 
> but this too results in a server error.
> 
> Any suggestions?
> 
> Thanks.

Order matters.


urlpatterns = patterns('',
   (r'^wkw1/$', 'sw1.wkw1.views.index'),
)

urlpatterns += patterns('django.views.generic.simple',
  ('^admin/$', 'redirect_to', {'url': '/admin/wkw1/lawyer/'}),
)

urlpatterns += patterns('',
   (r'^admin/', include(admin.site.urls)),
)


Adam Knight
codepoetry - http://www.codepoetry.net/products/

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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=.


Reply via email to