from django.core.urlresolvers import reverse
from django.http import HttpResponsePermanentRedirect

from django.conf.urls import patterns, include, url


urlpatterns = patterns('',
    # Redirect the base URL to the dashboard.
    url(r'^$', lambda r: HttpResponsePermanentRedirect(reverse('dashboard'))),

    url('', include('timepiece.crm.urls')),
    url('', include('timepiece.contracts.urls')),
    url('', include('timepiece.entries.urls')),
    url('', include('timepiece.reports.urls')),
)

from django.conf.urls import patterns, include, url
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView


urlpatterns = patterns('',
    # Redirect the base URL to the dashboard.
    url(r'^$', RedirectView.as_view(url=reverse_lazy('dashboard')),

    url('', include('timepiece.crm.urls')),
    url('', include('timepiece.contracts.urls')),
    url('', include('timepiece.entries.urls')),
    url('', include('timepiece.reports.urls')),
)

Use generic RedirectView rather than lambda function
Use generic RedirectView rather than lambda function
