Adam and Skylar,

The ISP's support just replied to my ticket. They set the urls.py as

urlpatterns = patterns('',
    (r'^wkw1/$', 'sw1.wkw1.views.index'),
    (r'^admin/$', 'django.views.generic.simple.redirect_to', {'url': '/
admin/wkw1/lawyer'}),
    (r'^admin/wkw1/$', 'django.views.generic.simple.redirect_to',
{'url': '/admin/wkw1/lawyer'}),
    (r'^admin/', include(admin.site.urls)),
)

and this is now working.

But looking at the example in the documentation
http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-simple-redirect-to

urlpatterns = patterns('django.views.generic.simple', ('^foo/(?P<id>\d
+)/$', 'redirect_to', {'url': '/bar/%(id)s/'}),)

I see that it is a little different. I am confused because I don't
exactly understand how urlpatterns works. I hope to read about it
more, e.g., I found this document with lots of examples:

http://www.scribd.com/doc/4975790/urlpatterns-for-django-cheatsheet

Thanks for the help.


On Nov 18, 11:09 am, Skylar Saveland <skylar.savel...@gmail.com>
wrote:
> What are the details of the error?
>
> On Nov 18, 7:06 am, Zeynel <azeyn...@gmail.com> wrote:
>
>
>
> > I've been trying to redirect
>
> > /admin/ to /admin/wkw1/lawyer
>
> > The suggestions from my previous 
> > posthttp://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-...
>
> > 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.

--

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