Q:

Redirect django URL to particular app

I am new to Django(1.7). As per my current configuration I am able to visit my app via url "www.mydomainname.com/blog".
I want to redirect "www.mydomain.com" automatically to "www.mydomainname.com/blog".
Please provide me suitable solutions.
My current urls.py has
url(r'^admin/', include(admin.site.urls)),
url(r'^blog/',include('blog.urls')),

A:

Use RedirectView
from django.views.generic.base import RedirectView
urlpatterns = patterns('',
    url(r'^$', RedirectView.as_view(pattern_name='blog'), name='blog_view'),
)

Update: By default RedirectView return 301. So recommend to include permanent 
url(r'^$', RedirectView.as_view(pattern_name='blog', permanent=False), \
    name='blog_view'),

