from django.conf.urls.defaults import patterns

import os

app_dir = os.path.dirname(__file__)

urlpatterns = patterns(
    '',
    (r'^media/(.*)$', 'django.views.static.serve', {
        'document_root': '%s/media' % app_dir}),
)

try:
    from django.conf.urls import patterns
except ImportError:
    from django.conf.urls.defaults import patterns

import os

app_dir = os.path.dirname(__file__)

urlpatterns = patterns(
    '',
    (r'^media/(.*)$', 'django.views.static.serve', {
        'document_root': '%s/media' % app_dir}),
)

fix patterns import to work with Django 1.6