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

urlpatterns = patterns('private_media.views',
    url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), 'serve_private_file',),
)

from django.conf.urls import url
from django.conf import settings

from views import serve_private_file

urlpatterns = [
    url(r'^{0}(?P<path>.*)$'.format(settings.PRIVATE_MEDIA_URL.lstrip('/')), serve_private_file),
]

Update for Django 1.10