title: name 'settings' is not defined
body: <p>I add urls in these lines for media and image output to the template. But I meet such a bug.
  <strong>name 'settings' is not defined</strong>
   How do I fix it?</p>
  
  <pre><code>urlpatterns =+ patterns('',
      url(r'^static/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {
          'document_root': settings.STATIC_ROOT,
      }),
      url(r'^media/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {
          'document_root': settings.MEDIA_ROOT,
      }),
  </code></pre>